In this tip i show you how we can open android play store app from webview.
Open Play Store App from WebView Android .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
String surl = obj.getString("URL"); WebView webView = (new WebView(this)); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.e("here", "++++++++++++++" + url); if (Uri.parse(url).getScheme().equals("market")) { try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); return true; } catch (ActivityNotFoundException e) { // Google Play app is not installed, you may want to open the app store link return false; } } return false; } }); webView.loadUrl(surl); |
Comments are closed, but trackbacks and pingbacks are open.