open App by package name - Android android.content.pm

Android examples for android.content.pm:App

Description

open App by package name

Demo Code

import android.content.Context;
import android.content.Intent;

public class Main {

  public static void openApp(Context context, String packageName) {
    Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName);
    context.startActivity(intent);/*from  w ww.j  ava2  s  .co  m*/
  }

}

Related Tutorials