@Override 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; } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //Set up the webview ConfigXmlParser parser = new ConfigXmlParser(); parser.parse(this); SystemWebView webView = (SystemWebView) findViewById(R.id.cordovaWebView); webInterface = new CordovaWebViewImpl(new SystemWebViewEngine(webView)); webInterface.init(cordovaInterface, parser.getPluginEntries(), parser.getPreferences()); webView.loadUrl(parser.getLaunchUrl()); }
/** * Getter for the startup page. * * @return startup page relative path */ private String getStartingPage() { if (!TextUtils.isEmpty(startingPage)) { return startingPage; } ConfigXmlParser parser = new ConfigXmlParser(); parser.parse(cordova.getActivity()); String url = parser.getLaunchUrl(); startingPage = url.replace(LOCAL_ASSETS_FOLDER, ""); return startingPage; }
@SuppressWarnings("deprecation") protected void loadConfig() { ConfigXmlParser parser = new ConfigXmlParser(); parser.parse(this); preferences = parser.getPreferences(); pluginEntries = parser.getPluginEntries(); }
@SuppressWarnings("deprecation") protected void loadConfig() { ConfigXmlParser parser = new ConfigXmlParser(); parser.parse(getActivity()); preferences = parser.getPreferences(); preferences.setPreferencesBundle(getActivity().getIntent().getExtras()); //preferences.set("webview", "io.syng.cordova.plugin.WebViewEngine"); pluginEntries = parser.getPluginEntries(); Config.init(getActivity()); }
private String getConfigLaunchUrl() { ConfigXmlParser parser = new ConfigXmlParser(); parser.parse(this.cordova.getActivity()); return parser.getLaunchUrl(); }