用SharedPreferences存储EditText中数据,代码没问题,通过DDMS透视图,data\data\<packagename>
找不到存储数据的文件,模拟器调试时出现报错“***应用程序进程终止,请重试”。 

解决方案 »

  1.   

    建议你学习下这节课程
    http://blog.csdn.net/coolszy/archive/2011/05/21/6435970.aspx
      

  2.   

    声明:
    SharedPreferences sp;onCreate(.....)中读取
    sp=getSharedPreferences("wenjianming", MODE_PRIVATE);
    boolean init=sp.getBoolean("init", false);onDestory(..)中保存
    Editor editor=sp.edit();
    editor.putBoolean("init",init);
    editor.commit();
      

  3.   

    应该在ONSTOP里面就进行保存吧,要不然你的ACTIVITY返回的时候怎么获取状态?
      

  4.   


    那还不如放到onSaveInstance(Bundle bundle)中!!
      

  5.   

    onSaveInstance(Bundle bundle)不能确保每次被调用!!!