Android Intent Create getExtraObject(Activity context, String key)

Here you can find the source of getExtraObject(Activity context, String key)

Description

Used to get the parameter values passed into Activity via a Bundle.

Parameter

Parameter Description
context The current Context or Activity from which this method is called
key Extra key name.

Declaration

public static Object getExtraObject(Activity context, String key) 

Method Source Code

//package com.java2s;

import android.app.Activity;

import android.os.Bundle;

public class Main {
    /**/* w  ww .  ja  v a 2 s .  c  o  m*/
     * Used to get the parameter values passed into Activity via a Bundle.
     *
     * @param context The current Context or Activity from which this method is called
     * @param key     Extra key name.
     */
    public static Object getExtraObject(Activity context, String key) {
        if (context == null)
            return null;
        Object param = null;
        Bundle bundle = context.getIntent().getExtras();
        if (bundle != null) {
            param = bundle.get(key);
        }
        return param;
    }
}

Related

  1. callHTTPDownload(Context context, String chooserTilte, String url)
  2. callPhone(Context context, String number)
  3. constructGoogleCalendarIntentVariant1()
  4. constructGoogleCalendarIntentVariant2()
  5. createNotification(Intent resultIntent, Context current, final Class destination)
  6. gotoHome(Context context)
  7. locate(Context context, String chooserTilte, String lat, String lng, String addr)
  8. putParamters(Intent intent, Object[] parameters)
  9. to(Context context, Class cls)