I have used shared preference for session maintaining in my application. And storing userId and password in Shared preference . How to clear these data when I exit from my application. Because when I restart my application It will give the previous session. When I log out in my application and again start app it will work nicely. In logout I have made the shared preference data (userId and password) as null. but I want to clear all these data in application exit.
I have also used below permission in manifest file: "android.permission.CLEAR_APP_USER_DATA"
<uses-permission android:name="android.permission.CLEAR_APP_USER_DATA"></uses-permission>
But I dont know how to use them in coding.