I have designed a main menu in android, but now I have no idea how to open that application when I click some specific icon for that application.
Any help or hint will be appreciateable.
开发者_如何学CThanks alot.
You need to know the package and class names:
public static Intent getLaunchIntent(String packageName, String className) {
Intent intent = new Intent(ACTION_MAIN);
intent.addCategory(CATEGORY_LAUNCHER);
intent.setClassName(packageName, className);
intent.setFlags(FLAG_ACTIVITY_NEW_TASK
| FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
return intent;
}
精彩评论