Here you can find the source of getExtraObject(Activity context, String key)
Parameter | Description |
---|---|
context | The current Context or Activity from which this method is called |
key | Extra key name. |
public static Object getExtraObject(Activity context, String key)
//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; } }