title: Data entered in sqlite gets deleted automatically on app restart in android pie
body: <p>SQLite data gone disappeared after restarting app in android pie.App is working fine on other versions but in android pie when you restart the app few last entries are not visible.Database is not completely empty as other entries are showing.</p>
  
  <p>I have tried setting WAL mode false by disabling WriteAheadLogging which seems to work on some devices but the issue was not completely solved as some devices were still reprting problems so I tried to set PRAGMA journal mode to TRUNCATE but this also did not work.</p>
  
  <pre><code> public myDbHelper(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
      }
   @Override
      public void onConfigure(SQLiteDatabase db) {
          super.onConfigure(db);
          db.disableWriteAheadLogging();
  
        Cursor c1=db.rawQuery("PRAGMA journal_mode=TRUNCATE",null);
        c1.close();
      }
  
  
      public static synchronized myDbHelper getInstance(Context context) {
  
  
          if (mInstance == null) {
              mInstance = new myDbHelper(context.getApplicationContext());
           mInstance.setWriteAheadLoggingEnabled(false);
          }
          return mInstance;
      }
  </code></pre>
  
  <p>Then in my fragment:
  myDbHelper dbHelper = myDbHelper.getInstance(getActivity()); </p>
  
  <p>I am not getting any error messages ,it's just that few last entries are not showing as if they were not saved in database.Any help is highly appreciated.</p>