Android examples for android.app:Activity Start
get Start Activity
import java.util.List; import android.content.Context; import android.content.Intent; import android.content.pm.ResolveInfo; public class Main { public static String getStartActivity(Context cxt, String packName) { Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null); resolveIntent.addCategory(Intent.CATEGORY_LAUNCHER); resolveIntent.setPackage(packName);/*from w w w . j av a2 s.c o m*/ List<ResolveInfo> resolveinfoList = cxt.getPackageManager().queryIntentActivities(resolveIntent, 0); if (resolveinfoList != null && !resolveinfoList.isEmpty()) { ResolveInfo resolveinfo = resolveinfoList.get(0); if (resolveinfo != null) { return resolveinfo.activityInfo.name; } } return null; } }