Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8740205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:05:26+00:00 2026-06-13T11:05:26+00:00

I have a very simple WebView in my app which displays a Welcome dialog.

  • 0

I have a very simple WebView in my app which displays a “Welcome” dialog.

I send across the language for the server to respond with like so:

Map<String, String> noCacheHeaders = new HashMap<String, String>(2);
noCacheHeaders.put("Pragma", "no-cache");
noCacheHeaders.put("Cache-Control", "no-cache");
noCacheHeaders.put("Accept-Language", Locale.getDefault().toString());
mWebView.loadUrl("www.fake.com", noCacheHeaders);

This works fine – however, when I change the devices language, I want the WebView language to change as well, I can see the value for "Accept-Language" is changing correctly when debugging but the content isn’t changing in the WebView. I’ve looked for ways to stop caching which I describe below. None of them have the effect of making the site load differently after a language change.

To ensure that the server isn’t the caching problem I ensure the WebView content changes after I clear the “App Data” and restart. Pretty conclusive proof that the App is storing the WebView data.

So, I’ve followed many different suggestions which I’ve listed below. Not one of them is actually changing the content of my WebView:

From here which causes a crash:

mWebView.clearCache(true);
mContext.deleteDatabase("webview.db");
mContext.deleteDatabase("webviewCache.db");

Just this on it’s own (both before the loadURL, after it, and onProgress=100):

mWebView.clearCache(true);

From here:

mWebView.getSettings().setAppCacheMaxSize(0);

I’ve also tried this:

mWebView.getSettings().setAppCacheEnabled(false);

All result in the same behaviour. My WebView, when switching device language to English from German, still retained the German Website content.

Here is all of the code together:

    Map<String, String> noCacheHeaders = new HashMap<String, String>(2);
    noCacheHeaders.put("Pragma", "no-cache");
    noCacheHeaders.put("Cache-Control", "no-cache");
    noCacheHeaders.put("Accept-Language", Locale.getDefault().toString());

    mWebView.getSettings().setAppCacheEnabled(false); 
    mWebView.clearCache(true);
    mWebView.getSettings().setAppCacheMaxSize(0);

    mWebView.setWebChromeClient(new WebChromeClient() {
           public void onProgressChanged(WebView view, int progress) {                 
               mProgress.setProgress(progress);
               try {
                   getActivity().setProgress(progress);
                   if(progress == 100) {
                       mProgress.setVisibility(View.GONE);
                       mWebView.clearCache(true);
                   }
               } catch(Exception e) {
                   e.printStackTrace();
               }
           }
    });
    mWebView.loadUrl("www.fake.com", noCacheHeaders);
    mWebView.clearCache(true);      

Repeatable steps:

  1. Install app
  2. Open Webview – English Content.
  3. Force Stop App
  4. Change Device Language to German
  5. Open App & WebView – English Content.
  6. Force Stop App
  7. Clear App Data
  8. Open App & WebView – German Content.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:05:26+00:00Added an answer on June 13, 2026 at 11:05 am
     CookieSyncManager.createInstance(this);         
     CookieManager cookieManager = CookieManager.getInstance();        
     cookieManager.removeAllCookie();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple OpenGL app that displays arbitrary 3D models. I'd like to
I have a very simple Mac Cocoa app that just has a Web View
I have a very simple application and I cannot make the WebView to show
I have a very simple table called Member , which consists of the following:
I have very simple query that calls a UDF which splits a field by
This is a very simple task in every language I have ever used, but
I have very simple form, with input like this: <input id=my_id multiple=true type=file name=image_name[]
What am I missing? I have very simple client and server. The server uses
I have very simple query like this: SELECT * FROM `all_conversations` WHERE `deleted_1` !=
I have very simple html and js files - which I've included below. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.