title: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
body: <p>The exception only occurs in Android 7.0 Nougat (emulator) devices.</p>
  
  <blockquote>
    <p>java.lang.SecurityException: MODE_WORLD_READABLE no longer supported</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>public void SessionMaintainence(Context context) {
      this.context = context;
      preferences = context.getSharedPreferences(PREF_NAME, Context.MODE_WORLD_READABLE);
      editor = preferences.edit();
      editor.commit();
  }
  </code></pre>
  
  <p>LogCat:</p>
  
  <pre><code>&gt; E/AndroidRuntime: FATAL EXCEPTION: main
  &gt;                                                  Process: burpp.av.feedback, PID: 2796
  &gt;                                                  java.lang.RuntimeException: Unable to create application
  &gt; burpp.av.feedback.FeedbackApplication: java.lang.SecurityException:
  &gt; MODE_WORLD_READABLE no longer supported
  &gt;                                                      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5364)
  &gt;                                                      at android.app.ActivityThread.-wrap2(ActivityThread.java)
  &gt;                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
  &gt;                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
  &gt;                                                      at android.os.Looper.loop(Looper.java:154)
  &gt;                                                      at android.app.ActivityThread.main(ActivityThread.java:6077)
  &gt;                                                      at java.lang.reflect.Method.invoke(Native Method)
  &gt;                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
  &gt;                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
  &gt;                                                   Caused by: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
  &gt;                                                      at android.app.ContextImpl.checkMode(ContextImpl.java:2162)
  &gt;                                                      at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:363)
  &gt;                                                      at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:358)
  &gt;                                                      at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:164)
  &gt;                                                      at burpp.av.feedback.support.SessionMaintainence.&lt;init&gt;(SessionMaintainence.java:63)
  &gt;                                                      at burpp.av.feedback.FeedbackApplication.onCreate(FeedbackApplication.java:43)
  &gt;                                                      at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
  </code></pre>