Android Activity Home Get goHome(Activity ctx)

Here you can find the source of goHome(Activity ctx)

Description

go Home

License

Apache License

Declaration

public final static void goHome(Activity ctx) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import android.app.Activity;

import android.content.Intent;

public class Main {
    public final static void goHome(Activity ctx) {
        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);//from w  w  w  . j  a va  2s.  co m
        ctx.overridePendingTransition(0, 0);
    }
}

Related

  1. goHome2(Activity ctx)
  2. getHostActivity()