title: Cannot rename file in Shared Preferences
body: <p>I just want to restore the saved preferences, but an error occurs.</p>
  
  <p>Login Class:</p>
  
  <pre><code>SharedPreferences.Editor editor = settings.edit();
                          editor.putString("session_id", session);
                          editor.commit();
  </code></pre>
  
  <p>List Class:</p>
  
  <pre><code>editor.putInt("channel_id", map.get(lv2.getItemAtPosition(arg2).toString()));
  editor.commit();
  </code></pre>
  
  <p>Main Class:</p>
  
  <pre><code>public class MainScreen extends Activity{
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          TextView tv = (TextView) findViewById(R.id.mainscreen);
          final SharedPreferences settings = getSharedPreferences("pref", 0);
          String tmp= settings.getString("session_id", "Error") + "ID: " +String.valueOf(settings.getInt("channel_id", -1));
          tv.setText(tmp);
          setContentView(R.layout.mainscreen);
      }
  }
  </code></pre>
  
  <p>LogCat:</p>
  
  <pre><code>02-01 21:06:56.621: ERROR/ApplicationContext(25035): Couldn't rename file /dbdata/databases/android.skiptvad/shared_prefs/pref.xml to backup file /dbdata/databases/android.skiptvad/shared_prefs/pref.xml.bak
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035): FATAL EXCEPTION: main
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.skiptvad/android.skiptvad.MainScreen}: java.lang.NullPointerException
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.os.Handler.dispatchMessage(Handler.java:99)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.os.Looper.loop(Looper.java:123)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at java.lang.reflect.Method.invokeNative(Native Method)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at java.lang.reflect.Method.invoke(Method.java:521)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at dalvik.system.NativeStart.main(Native Method)
  02-01 21:06:56.727: ERROR/AndroidRuntime(25035): Caused by: java.lang.NullPointerException
  </code></pre>