go to Home Intent - Android android.content

Android examples for android.content:Intent

Description

go to Home Intent

Demo Code

import android.content.Context;
import android.content.Intent;

public class Main {

  public static void goHome(Context context) {
    Intent mHomeIntent = new Intent(Intent.ACTION_MAIN);
    mHomeIntent.addCategory(Intent.CATEGORY_HOME);
    mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
    context.startActivity(mHomeIntent);/*from   ww  w  .  jav  a2 s. co m*/
  }

}

Related Tutorials