-1

I have published a new update for my app but when I upgrade it from Play Store I have seen that application data were deleted. Why? Thanks

My Manifest:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

1

If you are using Sqlite and in code you drop table in onUpgrade this may occur!

@Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

      db.execSQL("DROP TABLE IF EXISTS '" + DATABASE_TABLE + "'");

}
Intsab Haider
  • 3,491
  • 3
  • 23
  • 32