Example usage for android.content Intent putExtras

List of usage examples for android.content Intent putExtras

Introduction

In this page you can find the example usage for android.content Intent putExtras.

Prototype

public @NonNull Intent putExtras(@NonNull Bundle extras) 

Source Link

Document

Add a set of extended data to the intent.

Usage

From source file:Main.java

public static void startNewActivity(Activity origin, Class<? extends Activity> newActivity, Bundle bundle) {
    Intent intent = new Intent(origin.getBaseContext(), newActivity);
    if (bundle != null)
        intent.putExtras(bundle);
    origin.startActivity(intent);//from  w ww . jav  a2 s .c om
}

From source file:Main.java

public static void startPackage(Activity activity, String s, String s1, Bundle bundle) {
    Intent intent = new Intent();
    intent.setComponent(new ComponentName(s, s1));
    intent.putExtras(bundle);
    activity.startActivity(intent);//w  ww  . j  a  v  a2  s. c  o  m
}

From source file:Main.java

public static void jumpForResult(Activity sourceActivity, Class<?> targetActivity, int requestCode,
        Bundle bdl) {//from ww  w . j  a va  2 s .  c  o  m
    Intent intent = new Intent(sourceActivity, targetActivity);
    if (bdl != null) {
        intent.putExtras(bdl);
    }
    sourceActivity.startActivityForResult(intent, requestCode);
}

From source file:Main.java

public static void setStartIntent(Activity activity, Intent intent) {
    Bundle extras = getStartExtras(activity);
    if (extras != null)
        intent.putExtras(extras);
}

From source file:Main.java

public static void Broadcast(String action, Bundle bundle, Context context) {
    Intent intent = new Intent();
    intent.setAction(action);//from  w  w  w .  j ava 2 s .  co  m
    if (bundle != null) {
        intent.putExtras(bundle);
    }
    context.sendBroadcast(intent);
}

From source file:Main.java

private static void sendActionCommand(Context ctx, String action, Bundle extras) {
    Intent intent = new Intent();
    intent.setAction(action);/*  ww  w  . java2 s  .co  m*/
    if (extras != null) {
        intent.putExtras(extras);
    }
    ctx.sendBroadcast(intent);
}

From source file:Main.java

public static void openActivity(Context context, Class<?> activity, Bundle b) {
    Intent intent = new Intent(context, activity);
    if (b != null)
        intent.putExtras(b);

    context.startActivity(intent);//from www  .j  av a 2  s.  co  m
}

From source file:Main.java

public static void goTo(Activity aty, Class clazz, Bundle bundle, boolean isFinish) {
    Intent intent = new Intent(aty, clazz);
    if (bundle != null) {
        intent.putExtras(bundle);
    }//from   w ww .j  a v a2s.c  o  m
    aty.startActivity(intent);
    if (isFinish) {
        aty.finish();
    }
}

From source file:Main.java

/**
 * Avvia una nuova activity/*from  www. j  av a  2 s. c  o m*/
 * @param context
 * @param activityClass
 * @param params
 */
public static void startActivity(Context context, Class<? extends Activity> activityClass, Bundle params) {
    Intent intent = new Intent(context, activityClass);
    if (params != null)
        intent.putExtras(params);
    context.startActivity(intent);
}

From source file:Main.java

public static void redirectActivity(Context fromClass, Class<?> toClass, Bundle bundle) {
    Intent intent = new Intent();
    intent.setClass(fromClass, toClass);
    if (null != bundle) {
        intent.putExtras(bundle);
    }//from ww  w .ja  va  2s.  c o m
    fromClass.startActivity(intent);

}