Unable to use shared preference values in class A extends BroadcastReceiver , Android
I am Unable to use shared preference values in a开发者_Go百科 class-say Class A that extends BroadcastReceiver. I do a commit in another class- an activity class, now I want to retrieve those set of values inside Class A that extends BroadcastReceiver.
You can use the Context
in the parameters of your BroadcastReceiver
method
/**
* @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)
*/
@Override
public void onReceive( Context context, Intent intent )
{
context.getSharedPreferences( name, mode );
精彩评论