android - AsyncTask progress dialog not appearing in some fragments -


i have fragments of them uses simple asynctasks same , derived same base task. in of them see progress dialog circle spinnin while executed in 1 doesn't appear despite fact task correctly executed.

why? i'm using default setting overriding doinbackground , onpostexecute.

could cause layouts(but in case similar?

this code of asynctask causing problem(both tasks , without progress dialog child of same task class)

/**     * asynctask che richiede dati al server     * @author pc     *     */    class murotask extends getdatatask {          jsonobject jobject;        serverinterface server = new serverinterface();        @override     protected boolean doinbackground(string... params) {          try {             jobject = server.runscriptobject(script_name, null);         } catch (ioexception e) {              e.printstacktrace();             return false;         }           return true;     }       @override     protected void onpostexecute(final boolean success) {       if (success) {         if (jobject != null){             if (parsejson(jobject)){             isempty = false;             setcontentmuro();             }             else{                 isempty = true;             }         }          else{              isempty = true;          }     }else{         toast.maketext(getactivity(),r.string.failed_connection, toast.length_short).show();         return;     }           }  } 

you must use getactivity() context progress dialog asynctask in fragments.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -