diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index fcaa0006..43ee7b1a 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -111,6 +111,7 @@ public class MainActivity extends AppCompatActivity public static final String ACTION_OPEN_URL = "com.github.dfa.diaspora_android.MainActivity.open_url"; public static final String ACTION_CHANGE_ACCOUNT = "com.github.dfa.diaspora_android.MainActivity.change_account"; + public static final String ACTION_CLEAR_CACHE = "com.github.dfa.diaspora_android.MainActivity.clear_cache"; public static final String URL_MESSAGE = "URL_MESSAGE"; private App app; @@ -438,6 +439,8 @@ public class MainActivity extends AppCompatActivity } else if(ACTION_CHANGE_ACCOUNT.equals(action)) { app.resetPodData(webView); Helpers.animateToActivity(MainActivity.this, PodSelectionActivity.class, true); + } else if(ACTION_CLEAR_CACHE.equals(action)) { + webView.clearCache(true); } } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java index ce282954..e8ab5ece 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java @@ -94,6 +94,9 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer }) .show(); return true; + case "pref_key_clear_cache": + intent.setAction(MainActivity.ACTION_CLEAR_CACHE); + break; default: intent = null; break; diff --git a/app/src/main/res/values/strings-preferences.xml b/app/src/main/res/values/strings-preferences.xml index 6f5358a2..1911b85a 100644 --- a/app/src/main/res/values/strings-preferences.xml +++ b/app/src/main/res/values/strings-preferences.xml @@ -46,4 +46,7 @@ Erase local session data and switch to another Diaspora pod/account This will erase all cookies and session data. Do you really want to change your account? + Clear cache + Clear WebView cache + \ No newline at end of file diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 881e0926..2f4d3d50 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -52,6 +52,12 @@ android:summary="@string/pref_desc_load_images" android:defaultValue="true" /> + + +