If you want to launch a application B from your application A then you can launch that by using intent Like this :
First define application B package name so that we can set launch intent :
Intent myIntent = getPackageManager().getLaunchIntentForPackage("com.package.B");
if (myIntent != null) {
// We found the activity now start the activity
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(myIntent);
} else {
// redirect to play store to choose an app?
myIntent = new Intent(Intent.ACTION_VIEW);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myIntent.setData(Uri.parse("market://details?id=" + "com.package.name"));
startActivity(myIntent);
}
here you can check package name of B application but if doesn't exist then you can redirect user to google play store to download that B application and then you can start.
0 Comment(s)