I was asked by my employers to developed a webview-based app.
> MainActivity will just check if there's already a SharedPreferences file
saved:
- if true, loads the information on that file;
> I also check if the URL registered in that file is an empty value
(""), in which case I
File.exist()
On Fri, Jan 15, 2016 at 6:39 PM, Pedro CLR wrote:
> I was asked by my employers to developed a webview-based app.
>
> > MainActivity will just check if there's already a SharedPreferences file
> saved:
> - if true, loads the information on that file;
>
thanks, the problem was the path I entered to get to the file I was
checking :)
once again thanks for the efficiency and the fast answering :)
thank you so much for you help
On Fri, Jan 15, 2016 at 6:59 PM Dawid Drozd
wrote:
> File.exist()
>
> On Fri, Jan 15, 2016 at
Hi,
I tried all ways how many i know.
That is my code block for test. (MainActivity.onCreate())
String REMEMBERME_PREF_NAME = "rememberme";
SharedPreferences sharedpreferences =
this.getSharedPreferences(REMEMBERME_PREF_NAME, Context.MODE_PRIVATE);
if (sharedpreferences.getString("email",
Hello.I make an apk with two activities and use SharedPreferences for store
user values but no workthis is my code...Need something extra to
manifest for work SharedPreferences?
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
Hi all,
I need your help to have a clarification for the preferences framework of
Android.
Accordingly to Google API Reference
(http://developer.android.com/reference/android/preference/PreferenceActivity.html)
I created my app preferences section by extending the PreferenceActivity
class
On Tue, Jul 31, 2012 at 9:55 AM, Sergio Panico sergio.pan...@gmail.com wrote:
1. Google API documentation talks about 2 styles for creating preference
sections of an app: one deprecated old style, and one newest technique
fragment-based. As per my understanding, with the first old method, all
Hello,
I want to have some preferences stored forever by my application,
for example username, remember me, etc...and other preferences to be
stored only until the application is closed, or the user logs out. So
basically my question is how do I delcare which preferences must be
stored for ever,
The stuff that should be cleared when the application is closed by
the OS are not preferences, so do not implement them as such. Use
static data members or something along those lines, so they will go
away automatically when Android terminates the process.
On Tue, Mar 6, 2012 at 10:00 AM,
I need to read a year variable to set a timer. I'm using shared
preferences to store the variable so it is available across the whole
app. At the completion of the timer, the year variable is advanced by
one and writes back to the shared preferences. I have chased and
checked and the year variable
On Sat, Dec 17, 2011 at 11:22 PM, Larry/MavrickProductions
ohiooutofdo...@gmail.com wrote:
SharedPreferences prefs
= PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences myPrefs =
this.getSharedPreferences(settings, MODE_PRIVATE);
final SharedPreferences.Editor prefsEditor
Are you trying to let the user change the value with a preference activity,
and still get access to the value from code?
If so, make sure that the shared prefs storage is the same in both cases:
Option 1:
- In your code snippet, call
PreferenceManager.getDefaultSharedPreferences() rather than
I have a need to store a single value - the year - so that it can be
called from any activity in my app. Shared Preferences seems to be the
easiest but I've got myself coded into a wall and could use a spot of
advice.
I think the problem is in my XML, but I'm not sure. Here's the
pertinent snip
Dear All :
I had use getSharedPreferences, edit, putString commit to save
the setting in activity A successfully. I start another Activity B
from Activity A. I can display the setting on the Activity A. I also
use the same command to update the setting on the Activity B
(
On Sun, Jul 17, 2011 at 10:45 PM, mark2011 androidmark2...@gmail.comwrote:
What's wrong ? Can anyone help me?
Without the actual relevant code to look at, I'm not sure how much help
you're going to get.
On Sat, Apr 9, 2011 at 2:51 PM, behrooz abbasy behrooz.abb...@gmail.comwrote:
what should i do? :(
Debug your program.
-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit
I've been trying to save some state variables in the SharedPrefs, this
seems to work fine when onPause, and onStop are called but not when
OnDestroy() is called. When that happens the next time my activity
loads the preference values have disappeared.
Here is the code I use to save the variables:
Generally, I recommend PreferenceManager.getDefaultSharedPreferences()
to get the SharedPreferences, as that will be the one that
PreferenceActivity uses. Otherwise, your code seems fine. However,
bear in mind that onDestroy() is not guaranteed to be called, so you
may be better served writing
If you want to ensure the data is saved, it must be done in onPause().
Under low memory situations, an activity can be killed before its onStop()
is called.
On Sat, Dec 18, 2010 at 2:07 PM, Mark Murphy mmur...@commonsware.comwrote:
Generally, I recommend
Hello everybody,
This is my first question. I tried to ask in android-beginners, but
the group is discontinued.
My problem is using SharedPreferences. I just created a
PreferenceScreen which holds inside a ListPreference with an array
of 5 different values. Very simple! The array of values are
Hi
I have been trying to fix this problem for 3 days now and still no
luck. I am trying to save some preferences of my app (just a few
integers and strings), but I notice that SharedPreferences never
creates any xml file. So far I have tried the followings:
1) In my AndroidManifest, I set
I have a few questions on the default home screen's widget support:
1) if there are multiple instances of the same widget how to
differentiate each (so that the content could be different) eg. world
clock: same clock widget for different countries on diffferent
screen.
2) is there any
Hi All,
I've just tracked down a weird bug in our app where SharedPreferences
were failing between power cycles of the phone.
It turns out that one of the strings we were saving had an in it.
When I look at the xml that is being persisted I see that this is
being encoded as amp; instead of
Hi,
i'm implementing a feature that requires a password, is it safe to
store using SharedPreferences.Editor? Is there another recommended way
for storing passwords?
Thanks,
Teo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Hi,
I'm finding if I save pref's and then turn my G1 off and back on, they
have been erased. Is that the expected behaviour? I've seen similar
reports from a search, but cannot find a solution.
My code to save and restore is as follows:-
public void save() {
SharedPreferences
I have a PreferenceActivity that uses an xml file to automatically
populate and save the preferences. Sometimes though, when that
activity is started, the preferences are blank. However, if you go
back later, they will reappear.
This is causing a lot of headaches with my app. I have a Service
I'm on RC30, and I have not seen this issue first hand, but some of my
users are reporting that my app is losing its SharedPreferences after
about an hour, or some other unspecified time.
They say they are not uninstalling the application. The only way I
have seen the SharedPreferences be
Hi everyone,
Almost everything is in the title. I am trying to save username and
password into the sharedpreferences file. I used the little function
below to do so:
Everything works (The data are written correctly, I can read them
afterward) but the editor.commit() always returns false even
I made a simple login page, I pretty much regurgitated the
Forwarding example in the API Demo.
In addition, I added a Remember Me check box, which I promptly
stored in a SharedPreference as boolean. I did some digging in the
File Explorer, and found I could extract that XML file. Would I be
29 matches
Mail list logo