Android Utililty Methods Activity Home Get

List of utility methods to do Activity Home Get

Description

The list of methods to do Activity Home Get are organized into topic(s).

Method

voidgoHome(Activity ctx)
go Home
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
        | Intent.FLAG_ACTIVITY_CLEAR_TOP
        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
intent.addCategory(Intent.CATEGORY_HOME);
ctx.startActivity(intent);
ctx.overridePendingTransition(0, 0);
voidgoHome2(Activity ctx)
go Home
PackageManager packageManager = ctx.getPackageManager();
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
List<ResolveInfo> resolveInfos = packageManager
        .queryIntentActivities(intent,
                PackageManager.MATCH_DEFAULT_ONLY);
String myPackageName = ctx.getPackageName();
for (ResolveInfo ri : resolveInfos) {
...
ActivitygetHostActivity()
get Host Activity
return (currHostActivity.get());