问题
What is the best way to start one android app from another app? Is it to send custom broadcast event and have broadcast receiver of other app catch this event and do a start activity on something? Thanks
回答1:
Use an Intent: http://developer.android.com/guide/topics/intents/intents-filters.html
Use Context.startActivity() to just launch, or Activity.startActivityForResult() if you want to get a result when it's done.
If you are tightly coupled with the other application, you can use an explicit Intent. Otherwise, send an implicit Intent.
回答2:
best way is call by intent like this
http://www.lacherstorfer.at/haris_blog/2008/03/android-howto-invoke-a-phone-c.html
回答3:
Use this:
PackageManager pm = getPackageManager();
try
{
String packageName = "com.example.package";
Intent launchIntent = pm.getLaunchIntentForPackage(packageName);
startActivity(launchIntent);
}
catch (Exception e1)
{
}
来源:https://stackoverflow.com/questions/5281910/starting-one-android-app-from-another-app