Merge branch 'master' of https://github.com/syng-io/syng-client
This commit is contained in:
commit
4b50c62858
|
@ -11,6 +11,11 @@ import android.preference.PreferenceActivity;
|
|||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import org.apache.cordova.ConfigXmlParser;
|
||||
import org.apache.cordova.CordovaPreferences;
|
||||
import org.apache.cordova.CordovaWebView;
|
||||
import org.apache.cordova.CordovaWebViewImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.syng.R;
|
||||
|
@ -41,6 +46,21 @@ public class SettingsActivity extends PreferenceActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setupSimplePreferencesScreen();
|
||||
|
||||
Preference button = (Preference)findPreference("clearCache");
|
||||
button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
|
||||
ConfigXmlParser parser = new ConfigXmlParser();
|
||||
parser.parse(SettingsActivity.this);
|
||||
CordovaPreferences preferences = parser.getPreferences();
|
||||
preferences.setPreferencesBundle(SettingsActivity.this.getIntent().getExtras());
|
||||
CordovaWebView webView = new CordovaWebViewImpl(CordovaWebViewImpl.createEngine(SettingsActivity.this, preferences));
|
||||
webView.clearCache();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -143,7 +143,7 @@ public class WebViewFragment extends Fragment {
|
|||
}
|
||||
webView.getView().requestFocusFromTouch();
|
||||
cordovaInterface.onCordovaInit(webView.getPluginManager());
|
||||
webView.clearCache();
|
||||
//webView.clearCache();
|
||||
android.webkit.CookieManager.getInstance().removeAllCookie();
|
||||
|
||||
// Wire the hardware volume controls to control media if desired.
|
||||
|
|
|
@ -29,4 +29,8 @@
|
|||
android:summary="@string/pref_description_sync_only_on_wifi"
|
||||
android:title="@string/pref_title_sync_only_on_wifi"/>
|
||||
|
||||
<Preference android:title="Clear Cache"
|
||||
android:key="clearCache"
|
||||
android:summary="Clears cordova webview cache"/>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
Loading…
Reference in New Issue