W
W
webmaxat2016-08-17 18:28:11
Java
webmaxat, 2016-08-17 18:28:11

How to add SharedPreferences files to a project in AndroidStudio?

It is necessary that when installing the application, the settings.xml file goes into the /data/data/package_name/shared_prefs/ directory . to have preset settings.
How to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2016-08-17
@webmaxat

To set the default settings in onCreate you need to call
this will load the SharedPreferences data from the res/xml/preferences.xml file without overwriting the data set by the user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question