Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • start one application from another

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 254
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: