Questions tagged as 'sharedpreferences'

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
2
answers

Saving a list of elements with Shared Preferences

I'm creating a contact list and would like to save this list with SharedPreferences . Example: public class MeusContatos extends Activity implements OnClickListener { int pos=0; public static final String PREFS_NAME = "Preferences"...
asked by 23.04.2015 / 05:30
1
answer

Doubts on In App purchase Android

I have two doubts in In App purchase ... First I wanted to know what it would be like to hide the key64 that speaks in the test application that it has in Android Studio, because it is not recommended to leave a String in the same code...
asked by 06.01.2016 / 15:43
1
answer

Is there a session variable in Json [web service]?

Well, the mini world of my project is as follows:    I'm creating an application, where I will consume a database using the json method, where I validate the logged in user, but when asked to add some other information in the database, how wi...
asked by 04.08.2015 / 16:29
1
answer

Shared Preferences Android Stidop

I had to see a tuturial on youtube and I copied this code to save and delete inserted values, my doubt is that it always appears that "0" as it has below and I would like to know how I can remove it without giving error, I leave also the code an...
asked by 03.10.2017 / 12:44
2
answers

How to use sharedpreferences as class

I would like to know how I get to receive a data and assign it in a SharedPreferences class so that I can use this value whenever I need it. Below is my code and where I need it to change. This is a list of drives I get: ltsunidades....
asked by 11.04.2016 / 15:11
2
answers

Passing parameter to another activity with sharedPreference [duplicate]

I have a code where I will access a webservice that will be changing the ip weekly, I created a sharedpreference for the user to save the new ip and when that save my activity would pull that ip saved in the shared preference and would end up...
asked by 29.08.2017 / 20:35
1
answer

How can I separate the items of a sharedPreferences into an Array?

I'm having a question, I've made a checkbox on items in a listview that when marked are stored as SharedPreferences. Then I created a button (Favorites) to access the items marked by the checkbox, but the checked items go to Favorites I re-creat...
asked by 02.06.2017 / 21:52
1
answer

sharedpreferences in the first Activity, show only once?

I'm developing an app where it will have the first Activity fault, and I want to show it only once, only when the app is first opened. In this case, I created a Activity by calling a layout where it contains the textview and button...
asked by 22.02.2016 / 21:16
1
answer

Shared preferences saving wrong integer

I'm saving the user code (an integer) in the shared preferences: String a = Integer.toString(pUsuario.getCodigo()); SharedPreferences.Editor editor_Codigo = oCodigo.edit(); editor_Codigo.putString(pContext.getString(R.string.cod...
asked by 18.05.2018 / 15:42