开发者

how to getSharedPreferences in dialog?

i want to read file in dialog

can any开发者_StackOverflow社区 one guide me how to achieve this?

when i use

SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE); in dialog it gives me error "method is undefined"


Use the Context to access the preferences.

context.getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE);


You can get the context using super.getContext():

super.getContext().getSharedPreferences(PREFS_NAME, 0);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜