Shared preferences and textview

Search This thread

mistere372002

Senior Member
May 2, 2010
259
71
59
Tucson
www.ejuicesolutions.com
I originally asked this question in Srackoverflow. But I did not get any answers.

I am trying to set a text view number value to shared preferences using a string to get the values. Can anyone help with this?

Sent from my SGH-M919 using XDA Premium 4 mobile app
 
Dec 29, 2013
16
0
Storing Chronometer time in SharedPreferences

Thanks painless, that worked perfectly!

Sent from my SGH-M919 using XDA Premium 4 mobile app

I am actually trying to store the value of a chronometer in SharedPreferences but admittedly I have not worked with SharedPreferences much.

My end goal is to be able to close the Chronometer app and have the chronometer pick up from where it left off when the app is close.

Any help is appreciated.



Code:
 chronometer = (Chronometer) findViewById(R.id.Chronometer1);

public void startClick (View view){
    	 	
    
    	
    	
    	 chronometer.setBase(SystemClock.elapsedRealtime());
         chronometer.start();
         Vibrator vib = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
 		vib.vibrate(100);
        }