I am trying to show activity chooser menu when dialing a number. Following code works for me when sending an email (from real phone,doesn’t work in emulator):
/* Create the Intent */
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
/* Fill it with Data */
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"to@email.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
/* Send it off to the Activity-Chooser */
this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
But when I change the code as:
Intent call = new Intent(android.content.Intent.ACTION_CALL);
call.setData(Uri.parse("tel:" + phoneNo));
this.startActivity(Intent.createChooser(call, "Hello there..."));
No activity chooser menu is shown, just straight dial. I also want to list skype in that menu. Do you have any idea?
As someone else answered in one of your previous questions, you really do need to read up on Intents and Filters. I’ll give you a quick explanation though. An
Intentis a type of message that Android applications can register to handle. If Skype is not installed, then it won’t be able to register for thatIntentand so won’t show up in that menu. If it is installed and still doesn’t show up, that means it’s not registered for thatIntent. I don’t know the Android Skype app, but judging from the picture you linked in the other question, it seems that it does register for thatIntentand will show up when installed.