What if you get an exception in:
try {
imageurl = new URL(extracted);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Then your imageurl will be null. So, here:
try {
bitmap = BitmapFactory.decodeStream(imageurl.openConnection()
.getInputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
you will get NullPointerException because imageurl
is only declared but not initialised. So change this at the top:
URL imageurl=null
Hope this works. Best of luck.