Problem is in ASyncTask class in Android?

I don't think you can update the UI directly from doInBackground as the code in this method is run in a backgound thread and does not have direct access to the IU thread. You can update the UI either from onPostExecute or from onProgressUpdate You can call the latter of these from doInBackground by calling publishProgress There is a simple example in the documentation for AsyncTask, and this one is a little more complex.

I don't think you can update the UI directly from doInBackground, as the code in this method is run in a backgound thread and does not have direct access to the IU thread. You can update the UI either from onPostExecute or from onProgressUpdate. You can call the latter of these from doInBackground by calling publishProgress.

There is a simple example in the documentation for AsyncTask, and this one is a little more complex.

I'd like to suggest a slightly different way of thinking about the problem. Instead of having a thing in the background which both downloads and draws the bitmaps, you might try making the doInBackground method decode and return the Bitmap, then draw it onto the canvas in onPostExecute. This arrangement should prevent you from having contention on the canvas.

Looking at the code you've posted, the loaded bitmaps get drawn onto canvas. Then bitmap gets displayed in image. I can't see, in the code you posted, anywhere that the loaded bitmaps canvas gets sent to the screen.It might be worth double-checking that the image you're drawing to has a large enough height and width.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions