start Activity For Data - Android android.app

Android examples for android.app:Activity Start

Description

start Activity For Data

Demo Code

import android.app.Activity;
import android.content.Intent;

public class Main {

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

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

}

Related Tutorials