private void startPttApp(Context context,String pkgName){
Log.i(TAG,"startPttApp >> begin");
Intent intent = context.getPackageManager().getLaunchIntentForPackage(pkgName);
String className = intent.getComponent().getClassName();
ComponentName componet = new ComponentName(pkgName, className);
Intent i = new Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_LAUNCHER)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
i.setComponent(componet);
context.startActivity(i);
Log.i(TAG,"startPttApp >> end");
}
android launcher启动应用
最新推荐文章于 2024-09-22 13:32:22 发布