Skip to content

Instantly share code, notes, and snippets.

@shishirthedev
Created January 23, 2019 18:52
Show Gist options
  • Select an option

  • Save shishirthedev/cef31f25c19641b0b76e345081352a3b to your computer and use it in GitHub Desktop.

Select an option

Save shishirthedev/cef31f25c19641b0b76e345081352a3b to your computer and use it in GitHub Desktop.
private String getLauncherActivity(){
String activityName = "";
final PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(getPackageName());
List<ResolveInfo> activityList = pm.queryIntentActivities(intent,0);
if(activityList != null){
activityName = activityList.get(0).activityInfo.name;
}
return activityName;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment