Assume that I have a web-page named abc.html as follows:
<!DOCTYPE html>
<body>
<div class="a"><p>Only display this</p></div>
<div class="b"><p>Don't display this</p></div>
<div class="c"><p>Don't display this</p></div>
</body></html>
Can you please give me any idea how can I display only the <div class="a">
in android webview.
Here is my code to load full web-page
public class CustomWebsite extends Activity {
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_website);
webView = (WebView) findViewById(R.id.webView_test);
webView.setWebViewClient(new myWebClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://skyasim.info/abc.html");
}
public class myWebClient extends WebViewClient
{
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url);
return true;
}
}
}