Right now I have this:
@SuppressLint({"SetJavaScriptEnabled", "ClickableViewAccessibility"})
private void createWebViewer(WebView webView, FrameLayout frameLayout, String profile) {
webView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
webView.requestFocus(View.FOCUS_DOWN);
webView.setOnTouchListener((v, event) -> {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_UP:
if (!v.hasFocus()) {
v.requestFocus();
}
break;
}
return false;
});
frameLayout.addView(webView);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setAppCachePath(getCacheDir().getAbsolutePath() + "/profiles/" + profile);
webSettings.setAppCacheEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
webSettings.setJavaScriptCanOpenWindowsAutomatically(false);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setUserAgentString("WebView Client");
webView.loadUrl(url);
But even tho I'm setting: webSettings.setAppCachePath(getCacheDir().getAbsolutePath() + "/profiles/" + profile); the cache still goes to the default cache location.
Any ideas of what I'm doing wrong?