Can you share me the complete code of the class in which you have
implemented this shared preference block
On Monday, December 21, 2015 at 4:08:28 PM UTC+5:30, Cihan KALOĞLU wrote:
>
> Hi,
>
> I tried all ways how many i know.
>
> That is my code block for test. (MainActivity.onCreate())
>
> String REMEMBERME_PREF_NAME = "rememberme";
> SharedPreferences sharedpreferences =
> this.getSharedPreferences(REMEMBERME_PREF_NAME, Context.MODE_PRIVATE);
> if (sharedpreferences.getString("email", "").equals("")) {
> Log.d("SHARED PREF", "onCreate() returned: " + "CAN'T REMEMBER");
> SharedPreferences.Editor editor = sharedpreferences.edit();
> editor.clear();
> editor.putString("email", "REMEMBERED");
> editor.commit();
> }
> Log.d("SHARED PREF", "onCreate() returned: " +
> sharedpreferences.getString("email", ":("));
>
>
>
>
> This code working for all new apps or other existing apps but it still
> doesn't work for my app.
>
> What is wrong with my app?
>
> Could anybody help me?
>
> Thank you.
>
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/1eae2e6c-3c7c-4208-915b-207bc0fecc4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.