Questions tagged as 'sharedpreferences'

1
answer

Android Studio- save object in sharedPreferences [duplicated]

I want to save an object in sharedPreferences but I do not know how it is done. Could someone guide me with an example?     
asked by 10.03.2017 / 05:58
1
answer

Save animation frame by frame

I have a frame by frame animation in xml. My question is whether it is possible to save it in shared preferences and how to do it. Thank you. <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.andr...
asked by 06.12.2016 / 17:49
1
answer

Store date with which an app is started

There is some way to store a date entered (when you start the app) and that with that date stored, every time you start the app it is not necessary to return it to enter. When entering that date, through Calendar, it performs operations (adds an...
asked by 22.08.2016 / 04:56
1
answer

Remove Preferencefragment edge when performing inflate - Android

I'm having a problem with an app I'm developing. I have noticed that a screen does not look well below a certain API I put the code and some captures. This is the preferences section. I'm doing it with the Android studio wizard, it has...
asked by 06.09.2016 / 17:48
1
answer

How to use a checkBoxPreference

I am trying to make an options menu with an option to deactivate / activate notifications, I have a PreferenceScreen defined in XML with a CheckBoxPreference in preferences.xml <?xml version="1.0" encoding="utf-8"?> <...
asked by 31.10.2016 / 10:15
1
answer

SharedPreferences just save me and load a data

hi I did these processes to save and load SharedPreferences a few locations, I have 3 buttons and when I press the current location is saved, now the problem is this if I save the location in one of the buttons I close the application and...
asked by 04.07.2018 / 04:14
2
answers

How to use the SharedPreferences in a service?

Well my problem is this, In a service every certain amount of time I send the location and the id of the user I keep it in the SharedPreferences and when I want to get the data to send it I can not and I get this error FATAL EXCEPTION: main...
asked by 24.10.2017 / 00:23
1
answer

How to save data permanently on a screen (Fragment or Activity) on android even if you leave it?

I hope you can support me with this doubt that does not let me move forward with the app I'm doing. How can I store two data on the screen2 from the screen1 permanently, so that when I go to another screen and return I still have the same data....
asked by 18.10.2017 / 23:49
1
answer

Variable problem sharedpreferences

I'm doing an app where I try to create an event, save the date and time in a certain format and then retrieve them. Android Studio tells me    "can not find symbol" as it does not find the variables. I define the variables later, but beca...
asked by 11.07.2017 / 18:34
1
answer

how to know if a switch is on / off in Android Switch Preference?

I want to know if the switch is activated or destactivated when I clicked on it. I have the following: enable_social_recommendations = (Preference) findPreference("enable_social_recommendations"); enable_social_recommendati...
asked by 09.02.2017 / 02:10