start Activity For Int Data - Android Activity

Android examples for Activity:Activity Start

Description

start Activity For Int Data

Demo Code


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

public class Main {

    public static void startActivityForIntData(Activity activity,
            Class<?> cls, int data) {
        Intent intent = new Intent(activity, cls);
        intent.putExtra("data", data);
        activity.startActivity(intent);/* w  w w .ja va2  s .  c o  m*/
    }

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

Related Tutorials