mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
Fix crash when Clear App Data and try to access
This commit is contained in:
parent
96ce49707b
commit
491a8b71a2
1 changed files with 8 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.owncloud.android.ui.activity;
|
package com.owncloud.android.ui.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.app.Activity;
|
||||||
|
import android.app.ActivityManager;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
@ -77,8 +78,9 @@ public class ManageSpaceActivity extends AppCompatActivity {
|
||||||
appPrefsEditor.putBoolean("set_pincode", passCodeEnable);
|
appPrefsEditor.putBoolean("set_pincode", passCodeEnable);
|
||||||
appPrefsEditor.commit();
|
appPrefsEditor.commit();
|
||||||
|
|
||||||
String message = getString(R.string.manage_string_message, getString(R.string.app_name));
|
|
||||||
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
|
finish();
|
||||||
|
System.exit(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,9 +91,9 @@ public class ManageSpaceActivity extends AppCompatActivity {
|
||||||
String[] children = appDir.list();
|
String[] children = appDir.list();
|
||||||
for (String s : children) {
|
for (String s : children) {
|
||||||
if (!s.equals("lib")) {
|
if (!s.equals("lib")) {
|
||||||
deleteDir(new File(appDir, s));
|
File fileToDelete = new File(appDir, s);
|
||||||
Log_OC.i(TAG, "*******File /data/data/" + getString(R.string.app_name)+
|
deleteDir(fileToDelete);
|
||||||
"/" + s + " DELETED *******");
|
Log_OC.d(TAG, "Clear Application Data, File: " + fileToDelete.getName()+ " DELETED *******");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue