Skip to content

Instantly share code, notes, and snippets.

@Velmm
Created December 23, 2017 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Velmm/3cee379685dc55a932a05984c947f656 to your computer and use it in GitHub Desktop.
Save Velmm/3cee379685dc55a932a05984c947f656 to your computer and use it in GitHub Desktop.
ResolveInfo launchable=adapter.getItem(position);
ActivityInfo activity=launchable.activityInfo;
ComponentName name=new ComponentName(activity.applicationInfo.packageName,activity.name);
email.addCategory(Intent.CATEGORY_LAUNCHER);
email.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
email.setComponent(name);
startActivity(email);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment