Back to project page Twitter-Android.
The source code is released under:
Apache License
If you think the Android project Twitter-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package info.mahmoudhossam.twitter.Activities; /* w w w.j av a 2 s .co m*/ import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.KeyEvent; import android.webkit.WebView; import android.webkit.WebViewClient; import info.mahmoudhossam.twitter.R; public class Browser extends Activity { private WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.browser); webView = (WebView) findViewById(R.id.webView1); webView.getSettings().setJavaScriptEnabled(true); String Url = getIntent().getExtras().getString("url"); webView.setWebViewClient(new WebBrowser()); webView.loadUrl(Url); } private class WebBrowser extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); Intent data = new Intent("result"); if(url.contains("verifier")){ data.putExtra("url", url); setResult(RESULT_OK, data); finish(); } } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()) { webView.goBack(); return true; } return super.onKeyDown(keyCode, event); } }