• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps tel:12345678 Not working in webview. plz help

jack786

Lurker
Hello all this is my first post

below is my code... its not working... what wrong? plz help

What is wrong with my code. why still not working?

public class HomeActivity extends Activity {

WebView wv;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
wv=(WebView)findViewById(R.id.webView);
wv.setWebViewClient(new WebViewClient());
wv.loadUrl("http://myweb.com");
WebSettings ws= wv.getSettings();
ws.setJavaScriptEnabled(true);
wv.setWebChromeClient(new WebChromeClient());
}


public boolean shouldOverrideUrlLoading(WebView wv, String url) {
if (url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_CALL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
intent.setData(Uri.parse(url));
startActivity(intent);
}else if (url.startsWith("http:") || url.startsWith("https:")) {
wv.loadUrl(url);
}
return true;
}
}
 
Back
Top Bottom