0

I have an Android app where I have at the start of the app.

There is one weird thing happening with my app.

Even I delete app and re-install, the app takes last logged in data and show me that I am already logged in.

Below are the steps.

  1. Login to app as testuser
  2. Delete app
  3. Install app again
  4. Actually it should ask me for login, however it shows that I am already logged in with testuser.

OS that I have on Android is 7.0 on S6 Edge phone.

Note : I check on S4 and all is fine. It ask me to login on each re-install.


Goku
  • 9,102
  • 8
  • 50
  • 81
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276

1 Answers1

0

Apps that target Android 6.0 (API level 23) or higher automatically participate in Auto Backup. This is because the android:allowBackup attribute, which enables/disables backup, defaults to true if omitted. To avoid confusion, we recommend you explicitly set the attribute in the <application> element of your AndroidManifest.xml.

<application ...
    android:allowBackup="false">
</application>

Files that are backed up

By default, Auto Backup includes files in most of the directories that are assigned to your app by the system:

  • Shared preferences files.

  • Files in the directory returned by getFilesDir().

  • Files in the directory returned by getDatabasePath(String), which also includes files created with the SQLiteOpenHelper class.

  • Files in directories created with getDir(String, int).

  • Files on external storage in the directory returned by getExternalFilesDir(String).

for more information read Auto Backup for Apps

or when you logout Try to delete in manually like this

File preferenceFile = new File("/data/data/"+ getPackageName()+ "/shared_prefs/");
File[] listFiles = preferenceFile.listFiles();
for (File file : listFiles) {
    file.delete();
}
Goku
  • 9,102
  • 8
  • 50
  • 81