How to launch android applications from another application

前端 未结 2 1761
我寻月下人不归
我寻月下人不归 2021-02-11 10:37

I 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 o

相关标签:
2条回答
  • 2021-02-11 11:17
    Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
    startActivity(launchIntent);
    
    0 讨论(0)
  • 2021-02-11 11:34

    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); 
    
    0 讨论(0)
提交回复
热议问题