Example usage for android.content Intent putExtra

List of usage examples for android.content Intent putExtra

Introduction

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

Prototype

@Deprecated
@UnsupportedAppUsage
public @NonNull Intent putExtra(String name, IBinder value) 

Source Link

Document

Add extended data to the intent.

Usage

From source file:Main.java

private static final void markIntentAsNotRoot(Intent intent) {
    intent.putExtra(ARG_INTENT_NOT_ROOT, 0);
}

From source file:Main.java

static void setIsSharedElementTransition(Intent intent) {
    intent.putExtra(IS_SHARED_ELEMENT_TRANSITION, true);
}

From source file:Main.java

public static Intent getCropIntent(Intent intent) {
    intent.putExtra("crop", "true");
    intent.putExtra("aspectX", 1);
    intent.putExtra("aspectY", 1);
    intent.putExtra("outputX", 320);
    intent.putExtra("outputY", 320);
    intent.putExtra("return-data", true);
    return intent;
}

From source file:Main.java

public static void storeActivityNameToIntent(Intent intent, String name) {
    intent.putExtra(ACTIVITEIT_NAME, name);
}

From source file:Main.java

/**
 * Clears the internal extra./*  w  w  w .  jav a2  s  .com*/
 * 
 * @param intent
 */
public static final void clearInternalExtras(Intent intent) {
    intent.putExtra(EXTRA_RUN_AUTOMATION_COMPONENT, (String) null);
}

From source file:Main.java

private static void addPhotoPickerExtras(Intent intent, Uri photoUri) {
    intent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
    intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
    intent.setClipData(ClipData.newRawUri(MediaStore.EXTRA_OUTPUT, photoUri));
}

From source file:Main.java

public static void turnToActivityWithData(Context context, Class activityClass, Serializable bean) {
    Intent intent = new Intent();
    intent.putExtra(data_flag, bean);
    intent.setClass(context, activityClass);
    context.startActivity(intent);/*from w  w  w.  jav a2 s.  c  om*/
}

From source file:Main.java

public static Intent newIntentFromSelf() {
    Intent intent = new Intent();
    intent.putExtra(IS_FROM_SELF, true);
    return intent;
}

From source file:Main.java

public static Intent buildIntent(final Context context, String action, String data) {
    Intent intent = new Intent(action);
    intent.putExtra("what", data);
    intent.setPackage(context.getPackageName());
    return intent;
}

From source file:Main.java

public static void addCropExtras(Intent intent, int photoSize) {
    intent.putExtra("crop", "true");
    intent.putExtra("scale", true);
    intent.putExtra("scaleUpIfNeeded", true);
    intent.putExtra("aspectX", 1);
    intent.putExtra("aspectY", 1);
    intent.putExtra("outputX", photoSize);
    intent.putExtra("outputY", photoSize);
}