Can u paste the detail error log? Maybe the “myPrefs” is the old reference of the SharedPreferences,try to getSharedPreferences again before read it .I am not sure ,:-)
_____ From: [email protected] [mailto:[email protected]] On Behalf Of Jason Hensler Sent: Thursday, June 10, 2010 12:02 PM To: [email protected] Subject: Re: [android-developers] Force Close - Debug using the sharedpreferences.. my app keeps crashing when i have this code active.. text.setText(( int) myPrefs.getInt("state", 0)); is there anything wrong with this statement? --- This code is above that line that is error out: SharedPreferences myPrefs = this.getSharedPreferences("muter", MODE_WORLD_READABLE); SharedPreferences.Editor prefsEditor = myPrefs.edit(); int stt = AudioManager.STREAM_RING; prefsEditor.putInt( "state", stt); prefsEditor.commit(); On Wed, Jun 9, 2010 at 8:42 PM, 楊健 <[email protected]> wrote: What about “SharedPreferences”? Notice that the setting will not be delete even if you update your application ,but when you uninstall the application the setting will be lost. _____ From: [email protected] [mailto:[email protected]] On Behalf Of Jason Hensler Sent: Thursday, June 10, 2010 10:17 AM To: [email protected] Subject: [android-developers] Force Close - Debug Hello Team, Is there a writeini / readini functions for andriod/ecplise developent? Or what is the best way to 'remember' a setting, and then at a later time restore it? Thanks! Jason -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] <mailto:android-developers%[email protected]> For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] <mailto:android-developers%[email protected]> For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

