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

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to enable download in webview in Sketchware apps?

Create Stopwatch App in Android using Sketchware

Codes for modifying Action Bar in Sketchware

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

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

How to integrate Admob Ads in Sketchware project using AIDE?

Firebase Login/Register with email verification