Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch Skype from Android App programmatically

I create a call directly using the default os dialer by:

Intent call = new Intent(Intent.ACTION_CALL);
call.setData(Uri.parse("tel:" + phoneNo));
startActivity(call);

Is it possible to launch Skype directly from my app?

I try to pass a number as follows:

PackageManager packageManager = getPackageManager();
Intent skype = packageManager.getLaunchIntentForPackage("com.skype.raider");
skype.setData(Uri.parse("tel:65465446"));
startActivity(skype);

Passing the number fails.

like image 807
ruben Avatar asked Oct 10 '22 17:10

ruben


1 Answers

You need to know Skype package name (something like: com.skype.android), then you can start it:

PackageManager packageManager = getPackageManager();
startActivity(packageManager.getLaunchIntentForPackage("com.skype.android"));
like image 197
jamapag Avatar answered Oct 14 '22 00:10

jamapag