Widget - Webview Download Image

new DownloadImageTask(imageview1).execute("http://cyberghostnet.ga/images/logo/1494923529_409.gif");

 }

private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
ImageView bmImage;
public DownloadImageTask(ImageView bmImage) {
this.bmImage = bmImage;
}
protected Bitmap doInBackground(String urls) {
String urldisplay = urls[0];
Bitmap mIcon11 = null;
try {
java.io.InputStream in = new java.net.URL(urldisplay).openStream();
mIcon11 = BitmapFactory.decodeStream(in);
}
catch (Exception e) {
Log.e("Error", e.getMessage()); e.printStackTrace();
}
return mIcon11;
}
protected void onPostExecute(Bitmap result) {
imageview1.setImageBitmap(result);
}

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button

Animation Transtition Animation