Search code examples
javaandroidwebviewsmstelephony

WebView tel: open chooser telephone or sms


In my shouldOverrideUrlLoading of my WebView I do the following to have some action when a tel: link is clicked:

Intent tel = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity( tel );

My problem is that it only starts the telephone app (which seems to be the normal behaviour regarding tel: links). I want something like an intent chooser where I can select whether I want to send an sms or do a phone call. Is this possible with a tel: link?


Solution

  • Create a DialogFragment with 2 options and let the user decide what to do.