Shared preference does not get cleared after app uninstall?

Viewed 76

I just want to remove app data after uninstalling the android app I am using below code in manifest

<application android:name=".XX"
    android:allowBackup="false"
    android:fullBackupContent="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/xx"
    tools:replace="android:allowBackup">

allowBackup and fullBackupContent both attributes are not working Correctly May be this is due to library that is using allow backup true in there manifest and I thought my app is overwrite that setting from that library is there any possible way to get out of this and clear my app data every time when i install app.

2 Answers

Replace

android:allowBackup="false"

with

android:allowBackup="false"
    tools:replace="android:allowBackup"

Just replece your current code to this:

 <?xml version="1.0" encoding="utf-8"?>
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
              tools:replace="allowBackup"
              android:allowBackup="false"
             />

You have to do this:

1.add the xmlns:tools="http://schemas.android.com/tools" line in the manifest tag
2.add tools:replace=.. in the manifest tag
Related