go to Home Activity - Android Activity

Android examples for Activity:Activity Jump

Description

go to Home Activity

Demo Code


//package com.java2s;

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 .j  a  v a 2  s  . c  o m
}

Related Tutorials