start Intent Without History - Android Intent

Android examples for Intent:Intent Bundle

Description

start Intent Without History

Demo Code


//package com.java2s;

import android.app.Activity;

import android.content.Intent;

public class Main {
    public static void startIntentWithoutHistory(Activity activity,
            Class intentClass) {/*ww  w  . java2  s  .  c om*/
        Intent intent = new Intent(activity, intentClass);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        activity.startActivity(intent);
    }
}

Related Tutorials