Example usage for android.content Intent getExtras

List of usage examples for android.content Intent getExtras

Introduction

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

Prototype

public @Nullable Bundle getExtras() 

Source Link

Document

Retrieves a map of extended data from the intent.

Usage

From source file:Main.java

public static Bundle getSwitchMessages(Intent intent) {
    Bundle bundle = intent.getExtras();
    return bundle;
}

From source file:Main.java

public static String getSwitchMessage(Intent intent) {
    Bundle bundle = intent.getExtras();
    return bundle.getString(KEY_SWITCH);
}

From source file:Main.java

public static int getParameter(Intent i) {
    final Bundle extras = i.getExtras();
    if (extras == null)
        return -1;
    return extras.getInt(KEY_PARAMETER, -1);
}

From source file:Main.java

static public String[] unpackStartExperimentPlugins(Intent intent) {
    Bundle extras = intent.getExtras();
    if (extras == null)
        return null;
    return extras.getStringArray("plugins");
}

From source file:Main.java

public static Long getIntentLong(Intent intent, String value) {
    Bundle extras = intent.getExtras();
    Long result = 123456789L;/*from  w  ww. ja  v a 2 s  .  c  om*/
    if (extras != null) {
        result = extras.getLong(value);
    }
    return result;
}

From source file:Main.java

public static String getIntentString(Intent intent, String value) {
    Bundle extras = intent.getExtras();
    String result = "";
    if (extras != null) {
        result = extras.getString(value);
    }/*from w w  w . jav a  2s. c o  m*/
    return result;
}

From source file:Main.java

public static Bundle getBundle(Activity activity) {
    Intent intent = activity.getIntent();
    Bundle bundle = intent.getExtras();
    return bundle;
}

From source file:Main.java

private static Bundle getStartExtras(Activity activity) {
    Intent startIntent = activity.getIntent();
    return startIntent.getExtras();
}

From source file:Main.java

public static void dumpIntent(Intent i) {

    Bundle bundle = i.getExtras();
    if (bundle != null) {
        Set<String> keys = bundle.keySet();
        Iterator<String> it = keys.iterator();
        while (it.hasNext()) {
            String key = it.next();
        }/*from  ww  w . j  a  va2s  . c  o  m*/
    }
}

From source file:Main.java

/**
 * Remove all extras from intent//w w  w  .ja  v a 2  s. c o m
 */
public static void clearExtras(Intent intent) {
    Bundle extras = intent.getExtras();
    if (extras == null) {
        return;
    }
    for (String key : extras.keySet()) {
        intent.removeExtra(key);
    }
}