ANDROID - Clear DB/Cache while changing the language in android Phone/Tablet
<p>I have developed a app which supports FRENCH AND ENGLISH language. App is getting data from API.</p>

<p>I am using following code to store LAST UPDATED TIME for synch.</p>

<pre><code>  public static long getLastUpdatedTime(Context ctx) {
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);
    return sharedPref.getLong(PREF_LAST_UPDATED_TIME, 0);
}

public static void updateLastUpdatedTime(Context ctx, Long time) {
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);
    SharedPreferences.Editor ed = sharedPref.edit();
    ed.putLong(PREF_LAST_UPDATED_TIME, time);
    ed.commit();
}
</code></pre>

<p>App is working is fine but if user changes the LANGUAGE in phone/tablet then above stored value is not getting cleared. I want to clear cache when user switch from one language to other.</p>

<p>Is it possible? </p>

<p>I want to do this because I am appending last updated server time to URL while synching.</p>

<pre><code>timefromcache = getLastUpdatedTime(context);
synchurl = www.xyz.com/data/customers/?time=timefromcache
</code></pre>

<p>I want to get language specific data from server while changing the mobile/tablet language.</p>
