start Activity With Bundle - Android Activity

Android examples for Activity:Activity Start

Description

start Activity With Bundle

Demo Code


//package com.java2s;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class Main {

    public static void startActivityWithBundle(final Activity from,
            final Class<?> to, long delayMillis, final boolean finishSelf,
            final Bundle bundle) {
        new Handler().postDelayed(new Runnable() {

            @Override/*  w  ww .j  av a2s .com*/
            public void run() {
                Intent intent = new Intent(from, to);
                intent.putExtras(bundle);
                from.startActivity(intent);
                if (finishSelf == true) {
                    from.finish();
                }
            }
        }, delayMillis);
    }
}

Related Tutorials