Android How to - Get Launch Intent For Package








Question

We would like to know how to get Launch Intent For Package.

Answer

//  w  w w  .ja v a 2 s. c  o  m

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class Main {
  public static Intent getLaunchIntentForPackage(Context context, String packageName) {
    return context.getPackageManager().getLaunchIntentForPackage(packageName);
  }

}