Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onPageFinished(WebView view, String url) {
- Picture picture = view.capturePicture();
- Toast.makeText(finplan.this, "picture height "+picture.getHeight()+ " url "+url, Toast.LENGTH_LONG).show();
- mywebview.loadUrl("http://www.google.com");
- // this one works fine and picture.getHeight() is > 0
- mywebview.loadUrl("file:///android_asset/test.html");
- // this one works, but the picture.getHeight() retrieved in onPageFinished is always 0
- webView.setWebViewClient(new WebViewClient() {
- @Override
- public void onPageFinished(WebView view, String url) {
- Picture picture = view.capturePicture();
- }
- });
- webView.setPictureListener(new PictureListener() {
- public void onNewPicture(WebView view, Picture picture) {
- if (picture != null) {
- Toast.makeText(MainActivity.this,
- "picture height " + picture.getHeight(),
- Toast.LENGTH_LONG).show();
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement