android AsyncTask - can't execute onPostExecute method -


I have written an app to run an asyncTask and the code part is listed as follow. The problem occurs when the code By executing the asyncascate - "Add new addImageTask (). Execute ();" In thread handler, the work will start and everything seems right. However, after the execution of all code in the "doInBackground" method, the app will remain in the "doInBackground" method. The work can not go on "onPostExecute" method. (I.e., can not dismiss the dialogue ...) What could be wrong?

Thanks for the help ......

  Personal Handler Handlift = New Handler () {@ Override Public Wide Handmess (Message Message) {progressDialog.dismiss ( ); Log D. (Tag, "Start a handle fetch result"); Try {JSONArray ja = New JSONArray (fetchResult); Log D. (Tag, "Jason Array Length =" + ja.length ()); JSONObject that = new JSONObject (); For (int i = 0; i & lt; ja.length (); i ++) {joe = ja.getJSONObject (i); PhotoURLs.add (PAT_url + jo.getString ("FilePath")); Log D. (Tag, photo URL. Gate (i)); }} Catch (JasonAxception E) {Log D. (TAG, "Get the result error:" + E.A.T.O.Localized Message ()); E.printStackTrace (); } // TODO: Display the new AddImageTask () thumbnail. carry about (); } // void handleMessage}; // handler handloom resolt class AddImageTask asyncTask and lt; Zero, zero, zero> {@Override Secure Zero on PreExecute () {super.onPreExecute (); LoadThumbnailDialog.show (SitePhotoGallery.this, "Get Thumbnails From Server", "Loading ...", True, True); Log.d ("AddImageTask.onPreExecute", "onPreExecute"); } @ Override Protected Voice Doine Background (Zero ... unused) {// Auto-Generated Method for Todo (String URL: Photo URL) Stub {String file name = URL's bustring (url.list index ("/" ) + 1, URL Length ()); String thumburl = url.substring (0, url.lastIndexOf ("/") + 1); ImgAdapter.addItem (LoadThumbnailFromURL (thumburl + filename)); PublishProgress (); } Log D. ("AddImageTask.doInBackground", "doInBackground"); Return tap; } @ Override Protected Zero to Progress Update (Zero ... Unused) {super.onProgressUpdate (); ImgAdapter.notifyDataSetChanged (); Log.d ("AddImageTask.onProgressUpdate", "OnProgressUpdate"); } Secure zero on PetExecute (zero ... unused) {super.onPostExecute (empty); LoadThumbnailDialog.dismiss (); Log.d ("AddImageTask.onPostExecute", "onPostExecute"); }}    

I think this is because onPostExecute () < / Code> should take a zero parameter and do not take any zero ... parameters. (You should also specify @override , as mentioned by SoxX in the above comment.)

Comments