Reputation: 210
Hello guys I am new to android core apps but I love to do animation stuffs in Android. But what I want is I want to start another another app using my application. For eg. I want to start facebook app using my application. I dont know if the question is understood or not, but really need a clue on how to do such stuffs. Thank you!!
Upvotes: 1
Views: 68
Reputation: 381
check android's developer document about: Intent
refer to Context: startActivity startService sendBroadcast
Upvotes: 0
Reputation: 849
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(launchIntent);
In your case, you should check this apps package names and replace them.
It wouldn't be a bad idea to check if it's installed first :
private boolean isPackageInstalled(String packagename, Context context) {
PackageManager pm = context.getPackageManager();
try {
pm.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES);
return true;
} catch (NameNotFoundException e) {
return false;
}
}
Upvotes: 1