Questions tagged as 'sharedpreferences'

1
answer

Android - Share Preferences for another device

My question is: Can you share information saved by SharedPrefences to another device, either by bluetooth or another connection? MainActivity.java: SharedPreferences.EDITOR editor = getSharedPreferences("pref", MODE_PRIVATE).edit(); e...
asked by 08.05.2018 / 20:52
3
answers

how to show data from a sharedPreferences in a ListActivity

I'm starting to work with SharedPreferences on android, a simple and fast way to store static and primitive data. However, my problem is in showing these saved values in a ListActivity. I have already searched here in the forum, google tutoria...
asked by 02.03.2016 / 15:59
1
answer

How to add multiple numbers in Sharedpreferences and always keep the instance of SharedPreferences?

I needed to add a data in Sharedpreferences and it stored all data, not "zeroing" my data anymore. I'm using editor.putStringSet("data", dado); to store my data, I needed to keep this data forever. Is it possible to do that? Thank you in...
asked by 24.09.2015 / 17:19
0
answers

How to share data between multiple applications?

I have A, B, C and D apps and need to share data from those apps for a specific app (E) (Basically the login data, to auto login. As Messenger does, retrieving Facebook access data) . In this way the E app will only receive d...
asked by 22.03.2018 / 20:27
0
answers

Android: Error in getContext () when using SharedPreferences [duplicate]

I'm using SharedPreferences with Retrofit2 and notificações . Each time the Notification is executed I get the exception " 'java.lang.String android.content.Context.getPackageName()' on a null object reference ". I...
asked by 07.11.2017 / 22:17
1
answer

Error fetching Information from SharedPreferences Android

I have an android application, and in it I save some basic user information in SharedPreferences, however I started to display the following JSON parse error:    java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1...
asked by 14.04.2016 / 19:43
0
answers

Select cities with SharedPreference

Just when I click on "Itaborai" that saves the preference, how do I select the other items in the list view to enter other activities? As an example, the client clicked on "Itaborai" when it opens the app again will open directly to the Itaborai...
asked by 06.09.2015 / 13:11
2
answers

How to create a configuration screen in an Android app that appears only when the user is registered?

I'm developing an android with Firebase authentication, I need place a screen where the user will define a "nickname", but it must be immutable. Therefore, this screen must appear soon after the registration and only this time, when accessing...
asked by 02.08.2017 / 15:40
1
answer

Use a variable in an activity declared in another activity

In my application I have a SharedPreference variable that stores an int value for me. This value has to decrease as the user performs some actions, as if it were a counter. Let's say that each time the user presses a specific button this value s...
asked by 20.03.2015 / 19:41
1
answer

How do I store more than one value using SharedPreferences?

I'm making an app where I created a checkbox to represent a favorite item. The problem I'm having is what I'm having is when I put more than one item as a favorite, the last one replaces the first one, that is, it's allowing you to add only o...
asked by 29.05.2017 / 21:23