*Hi Dear,*
*Can u please explain how to stop or cancel downloading progress within
asyntask in android. Here's the my sample code. Please help me to solve
this problem.*
*private class DownloadPicture extends*
* AsyncTask<String, Void, Drawable> {*
* @Override*
* protected Drawable doInBackground(String... urls) {*
* try {*
* InputStream nextPicIs = (InputStream) new URL(urls[0])*
* .getContent();*
* Drawable nextPicDraw = Drawable.createFromStream(nextPicIs,*
* "Jathaka Katha");*
* nextPicIs.close();*
* return nextPicDraw;*
* } catch (Exception e) {*
* System.out.println("IMAGE EXCEPTION " + e);*
* return null;*
* }*
* }*
* @Override*
* protected void onPostExecute(Drawable result) {*
* if (result != null) {*
* Bitmap currentImg= ((BitmapDrawable) result).getBitmap();*
* img_view.setImageBitmap(currentKatha);*
* } else {*
*
img_view.setBackgroundResource(R.drawable.play_default);*
* }*
* onCancelled();*
* }*
* @Override*
* protected void onCancelled() {*
* super.onCancelled();*
* }*
* }*
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.