start Activity For String Data - Android Activity

Android examples for Activity:Activity Start

Description

start Activity For String Data

Demo Code


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

public class Main {

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

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

Related Tutorials