start Activity For Data - Android Activity

Android examples for Activity:Activity Start

Description

start Activity For Data

Demo Code


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

public class Main {

    public static void startActivityForData(Activity activity,
            Class<?> cls, String data) {
        Intent intent = new Intent(activity, cls);
        intent.putExtra("data", data);
        activity.startActivity(intent);//  ww  w . j a  v  a  2  s .  co  m
    }

    public static void startActivity(Activity activity, Class<?> cls) {
        Intent intent = new Intent(activity, cls);
        activity.startActivity(intent);
    }
}

Related Tutorials