How to run Android applications from another application

I want to run any of the existing Android applications (contacts, dialing, etc.). from my application after clicking a button.

All I know is to get the intent of a particular application and get started. But I do not know how to set the class path for the intent for contacts.

Am I following the right decision? What is the way to launch another application?

0
source share
2 answers

You really do not call another application - you generate an intent, and then wait for someone to pick it up. Do you mean the url of the contact as a "class path"? If so, Contacts.Intents is a helper class link that you can use to create contact intentions

Here is a short example:

Intent intent = new Intent();
intent.setAction(Contacts.Intents.SHOW_OR_CREATE_CONTACT); 
+5
source
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(launchIntent);
+1
source

Source: https://habr.com/ru/post/1756215/


All Articles