Skip to content

Instantly share code, notes, and snippets.

@iraSenthil
Created June 13, 2013 16:22
Show Gist options
  • Save iraSenthil/5775108 to your computer and use it in GitHub Desktop.
Save iraSenthil/5775108 to your computer and use it in GitHub Desktop.
public class MainActivity extends Activity implements OnClickListener {
private Button button;
private WebView webView;
private final static String CLIENT_ID = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
private final static String CLIENT_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
private final static String CALLBACK_URL = "com.example.runkeeperapi://RunKeeperIsCallingBack";
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Force to login on every launch.
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
button = (Button) findViewById(R.id.button);
webView = (WebView) findViewById(R.id.webView);
//This is important. JavaScript is disabled by default. Enable it.
webView.getSettings().setJavaScriptEnabled(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment