开发者

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 BroadcastReceivermethod

    /**
     * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)
     */
    @Override
    public void onReceive( Context context, Intent intent )
    {
        context.getSharedPreferences( name, mode );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜