====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
script_webview_with_refresh [2015/05/20 14:26] jappie [WV-resume] better timers |
script_webview_with_refresh [2015/05/20 14:44] (current) jappie [WV-resume] reload reloaded |
||
---|---|---|---|
Line 6: | Line 6: | ||
====== How to use the script ====== | ====== How to use the script ====== | ||
* make sure the Internet permission is added to the launcher through the installation of the plugin found at [[http://www.pierrox.net/android/applications/lightning_launcher/permissions/|http://www.pierrox.net/android/applications/lightning_launcher/permissions/]]. | * make sure the Internet permission is added to the launcher through the installation of the plugin found at [[http://www.pierrox.net/android/applications/lightning_launcher/permissions/|http://www.pierrox.net/android/applications/lightning_launcher/permissions/]]. | ||
- | * Import the script's from here. | + | * Import all three script's from here. |
- | * Set 'WV-create' script on a Custom View 'created' event. | + | * Set 'WV-create' script on Custom View 'created'-event. |
- | * Set 'WV-resume' script to event resume | + | * Set 'WV-resume' script on Custom View 'resume'-event. |
- | * Set 'WV-pause' script to event pause | + | * Set 'WV-pause' script on Custom View 'pause'-event. |
====== Script code ====== | ====== Script code ====== | ||
Line 50: | Line 50: | ||
if ((nu - last) > (refresh_interval_minutes *60000)) | if ((nu - last) > (refresh_interval_minutes *60000)) | ||
- | { myView.reload(); | + | { //myView.reload(); <-- seams to crash when it failed to load before. |
+ | //myView.loadUrl(myView.getUrl()); <-- alternative, if everything else fails | ||
+ | myView.loadUrl( "javascript:window.location.reload( true )" ); | ||
myItem.setTag(myId, nu); | myItem.setTag(myId, nu); | ||
} | } | ||
Line 60: | Line 62: | ||
refreshWV(); | refreshWV(); | ||
</code> | </code> | ||
- | |||
======= WV-pause ======= | ======= WV-pause ======= | ||
<code> | <code> |