开发者

How to launch android applications from another application

I开发者_StackOverflow want to launch any one of the existing android applications (contacts, call dialer, etc.) from my app upon on click of a button.

All that I know is to get the Intent of the particular app and start the activity. But I don't know how to set the class path for the intent for contacts.

Am I following the correct solution? What is the way to launch another application?


You don't really call another application - you generate the intent and then wait for someone to pick it up. Are you referring to Contact's app URL as "class path"? If so here's Contacts.Intents helper class reference that you can use to create Contacts intents

Here's a short example:

Intent intent = new Intent();
intent.setAction(Contacts.Intents.SHOW_OR_CREATE_CONTACT); 


Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(launchIntent);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜