start Intent With Message - Android Intent

Android examples for Intent:Intent Bundle

Description

start Intent With Message

Demo Code


//package com.java2s;

import android.app.Activity;

import android.content.Intent;

public class Main {
    public static void startIntentWithMessage(Activity activity,
            Class intentClass, String msgKey, String msgVal) {
        Intent intent = new Intent(activity, intentClass);
        intent.putExtra(msgKey, msgVal);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        activity.startActivity(intent);/*  w  ww . j a  v  a  2 s.  c  o  m*/
    }
}

Related Tutorials