android - How to set value in SharedPreferences as standard? -


I know that setting and receiving prices in shared preferences:

but it only works This is when the app has started.

I wonder how I can set some values ​​as standard so that they can set the app for the first time and set it also. So the code is not setting them, instead of writing something in string.xm

Is this possible?

Where is your SDK root? Check samples on shared prefixes ....

$ SDK_HOME / Sample / $ platform / APPDOMS / src / com / example / Android / API / Priority / Default value.Go

The sample you want is

Example in main_activity.onCreate ():

  PreferenceManager.setDefaultValues ​​(this, R.xml.your-defaults, false); ... PreferencesManager.getDefaultSharedPreferences (this) .getString ("default_user_oid", "default"). Equal ignoreCase ("default")    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -