android screenshot for long webpage

view story

http://stackoverflow.com – How to get screenshot of a webview if it too long and store it in internal storage. So for example if my webview shows "google.com" and i try below code it takes the screenshot and stores it as .jpg. But if my webview shows "stackoverflow.com", as this web page is too long, the app crashes. Some help will be appreciated. Picture picture=this.getCurrentWebView().capturePicture(); Bitmap b = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); picture.draw(c); FileOutputStream fos = null; try { (HowTos)