使用PhoneGap的Andr​​oid的高速缓存中删除 [英] Remove caching in Android using PhoneGap

查看:117
本文介绍了使用PhoneGap的Andr​​oid的高速缓存中删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android中移除缓存。我使用PhoneGap的技术。其实一切工作在黑莓或iOS罚款,但有问题的Andr​​oid。在我的应用程序,有站名的自动建议清单。当用户首次选择站,它是好的,但是当用户选择下一次同样的车站,它显示了大字体的站名(白色背景(单链表从我原来的电台列表不同),我认为是由于高速缓存)。

我认为这是由于使用Chrome的Andr​​oid来。请您建议我如何删除此缓存?

 <输入ID =getStationDescNAME =getStationDesc类型=文本级=log_txtfield禁用=禁用/>
<脚本>
    变种物镜= ACTB(的document.getElementById('getStationDesc'),stationList);
    //setTimeout(function(){obj.actb_keywords = CUSTOM2;},10000);
    this.actb_timeOut = -1;
    //元素的数量自动完成可以显示(-1:无限制)
    this.actb_lim = 10;
    //应该自动完成局限于关键字的开始?
    this.actb_firstText =真;
    //启用鼠标支持
    this.actb_mouse = TRUE;
    //分隔符多个自动完成。
    //将它设置为单自动完成空数组
    this.actb_delimiter =新阵列('',',');
    只有在此之后的字符数在键入//显示部件。
    this.actb_startcheck = 1;    this.actb_bgColor ='#dbe3ec';
    this.actb_textColor ='#00256a';
    this.actb_hColor ='#dbe3ec';
    this.actb_fFamily ='宋体';
    this.actb_fSize ='16px的';
    this.actb_hStyle =文本装饰:下划线;字体体重=黑体;文本align =left';
    功能FillValues​​()
    {
        。的document.getElementById('getStation code')值=的document.getElementById('getStationDesc')value.substring(0,3)。
    }
< / SCRIPT>


解决方案

您可以手动PhoneGap的清除缓存。我以前每次删除该应用程序的高速缓存存储器,应用程序加载之前。试试这个code,

  super.clearCache();
super.loadUrl(文件:///android_asset/www/index.html);

如果你愿意,你可以在还结束应用程序中使用。

更新:另一种解决办法,

您ACTB()函数后,调用页面创建,

  $(#指数)的触发器(pagecreate);
/ *#指数是在网页的id * /

I want to remove caching in Android. I am using PhoneGap technology. Actually everything is working fine in Blackberry or iOS, but there is problem in Android. In my app, there is an auto suggested list of station names. When the user selects station for the first time, it is fine, but when the user selects the same station next time, it shows the station name in big font (white background (single list different from my original station list), which I think is due to caching).

I think this is due to Android using Chrome. Would you please suggest me how to remove this caching?

<input id="getStationDesc" name="getStationDesc" type="text" class="log_txtfield" disabled="disabled"/>
<script>
    var obj = actb(document.getElementById('getStationDesc'),stationList);
    //setTimeout(function(){obj.actb_keywords = custom2;},10000);
    this.actb_timeOut = -1;
    // Number of elements autocomplete can show (-1: no limit)
    this.actb_lim = 10;
    // should the auto complete be limited to the beginning of keyword?
    this.actb_firstText = true;
    // Enable Mouse Support
    this.actb_mouse = true;
    // Delimiter for multiple autocomplete.
    // Set it to empty array for single autocomplete
    this.actb_delimiter = new Array(' ',',');
    // Show widget only after this number of characters is typed in.
    this.actb_startcheck = 1;

    this.actb_bgColor = '#dbe3ec';
    this.actb_textColor = '#00256a';
    this.actb_hColor = '#dbe3ec';
    this.actb_fFamily = 'arial';
    this.actb_fSize = '16px';   
    this.actb_hStyle = 'text-decoration:underline;font-weight="bold";text-align="left"';
    function FillValues()
    {
        document.getElementById('getStationCode').value = document.getElementById('getStationDesc').value.substring(0,3);               
    }
</script>

解决方案

You can clear cache manually in Phonegap. I used to remove cache memory of the application every time, before the application loads. Try this code,

super.clearCache();
super.loadUrl("file:///android_asset/www/index.html");

If you want, you can use in the application ending also.

UPDATED: Another solution,

after your actb() function, call the page create,

$("#index").trigger("pagecreate");
/*#index is the id of the page*/

这篇关于使用PhoneGap的Andr​​oid的高速缓存中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆