I load a .jpg
in a WebView
. My problem is that I found this: Android WebView, Scaling Image to fit the screen
and it doesn't work for me.
Here is my code:
Display display = getWindowManager().getDefaultDisplay();
int width= display.getWidth();
Toast.makeText(getApplicationContext(), ""+width, Toast.LENGTH_LONG).show();
String html = "<html><head><title>Example</title><meta name=\"viewport\"\"content=\"width="+width+", initial-scale=0.65 \" /></head>";
html+= "<body><img width=\""+width+"\"<img src=\""+"image.jpg"+"\" /></body></html>";
aboutText.loadDataWithBaseURL("file:///android_res/drawable/", html, "text/html","UTF-8" , null);