Tiker is a string which have name and value both + and - i want to change that with images... bt using this on + and - will hide bt image don't show...
so help to find my solution.
WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
tiker = tiker.replaceAll("\\+","<img src=drawable\"up.开发者_如何学运维PNG\">");
tiker = tiker.replaceAll("\\-","<img src=drawable\"down.PNG\">");
String summary = "<html><body><MARQUEE>"+tiker+"</MARQUEE></body></html>";
mWebView.loadData(summary, "text/html", "utf-8");
You cannot access images in 'drawable' directory from a WebView. You must put the images in 'assets' directory and access them with 'file:///android_asset/...'
精彩评论