Questions tagged as 'sharedpreferences'

1
answer

Appears null in place of the name retrieved

When I see the application, I see that in the variable nomedoHumano it appears null , and it was to appear the name of the user. Just below the Onclick method, I retrieve the typed name. I've already thought about putting...
asked by 14.10.2017 / 20:17
1
answer

Save value in SharedPreference

How do I save and retrieve information in an Android Prefence file. Example String a = "stack overflow" int b = 32; boolean c = true;     
asked by 11.07.2014 / 18:14
0
answers

SharedPreferences getting NullPointerException

I'm needing help with SharedPreference. I'm developing a phrases APP, where there is a checkbox that marks the favorite phrases and plays those phrases in SharedPreferences where they can be accessed from a button called bookmarks. The proble...
asked by 08.06.2017 / 23:49
1
answer

What is the best method of using SharedPreferences?

I have an application with a webview in which it returns a Token when the user logs in. I need to save the user information to auto-login the next time it logs in, I plan to do this using the CheckBox. After researching a lot, I saw that the bes...
asked by 16.02.2017 / 12:55
1
answer

How to retrieve the state of a button with SharedPreferences in Android / Kotlin on multiple screens?

Friends, I have two activities, the first one I have a sound button on and off and the second I have some buttons like for example a button of name A and when clicked it should know what the sound button is in the first activity ... if in the fi...
asked by 30.11.2016 / 12:05
0
answers

When trying to get the id of the user saved in sharedPreferences, sometimes it returns null

When I log in to the application, I save your data in SharedPreferences using GSON (to save the API response with id, name, email, etc.). The problem is that when I start the app, I check if the Model User is null. If it is not, it opens the...
asked by 25.08.2016 / 20:43
0
answers

how to use sharedpreferences

Good Afternoon will someone give me an example of how to create sharedpreferences ... I'm in a bad situation where .. I validate the user and password on the server using php via webservice and after validation I need to show the user to their c...
asked by 04.04.2016 / 18:24
1
answer

How to use the SharedPreferences of Android? Can I choose multiple file names?

I'm learning how to use android making an example application with various types of Android Studio functions. At the moment I have a list presented in a ListView and would like to save it. I use SharedPreferences and it works fine: saved and I c...
asked by 18.03.2016 / 11:48
0
answers

How to choose a video from the gallery to be standard and always playable?

I'm working on a program that is interactive with users. With this, the user can choose image or take a photo and replace with the one that was in ImageView . When you click on ImageView , a video for that image is played. T...
asked by 18.02.2016 / 04:35
0
answers

Shared Preferences - Some cell phones error

Is there any reason for an application that uses Shared Preferences to work on only a few phones? Yes, the reason for the particular application to stop working on some phones is Shared Preferences. If I leave the sharedpreferences annotated...
asked by 20.03.2016 / 06:12