문제

I'am making a game and make a website to store the Score Board when I call the webservise the old Score Board appears !!! I tried to open the webServise from the android browser but the browser appears the old Score Board when i "refresh" android web Browser the new one appears how can I Solve this Problem? this is my app link on the play store I need to update it soon

My Application

도움이 되었습니까?

해결책

I am using web Service not WebView and finally I found the solution

 HttpGet httpget = new HttpGet("http://example.com/dir/page.php?"+r.nextInt(1000));

putting a random number as a parameter make the request Different
thanx all

다른 팁

I assume you're using a WebView.

It's actually really simple. You should have Googled for "android webview disable cache" and you would see multiple resources...

WebView browser = new WebView(this);
WebSettings settings = browser.getSettings();
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
wv.addJavascriptInterface(new JavaScriptInterface(wv), "JSI"); -



  private class JavaScriptInterface {   
 private final WebView m_wv;  
  public JavaScriptInterface(WebView wv)
 {       m_wv = wv;   
 }  
  public void reload() 
{       m_wv.reload();   
} } 

See more at: http://gurushya.com/customizing-android-webview/#sthash.X87HCv01.dpuf

or other way is:

webView.loadUrl( "javascript:window.location.reload( true )" );
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top