android - Run another of the same stream -


run of same stream..

so can do?

@override     protected void doinbackground(void... params) {         if (iscancelled()) return null;         getsignins();          try {             androidhttptransport.call("http://tempuri.org/sig", envelope);                 soapobject response = (soapobject) envelope.getresponse();             sessionid = response.getproperty("sessionid").tostring();              androidhttptransport=null;             request=null;             response=null;             system.gc();              getreport("1");             log.d("pgguru", "*:sesid " + sessionid);          } catch (exception e) {              e.printstacktrace();             log.d("pgguru", "- error sess "+e.tostring());              dreplumclas drepluasync = new dreplumclas(context,activity);             drepluasync.execute();          }     }        return null;     } 

sometimes error comes 06-03 11:46:02.527: e/androidruntime(9693): java.lang.runtimeexception: error occured while executing doinbackground() ..... enter image description here

as error saying trying update view different thread why got exception calledfromwrongthreadexception.

i guessing coming getreport("1"); if want update view call main thread , update it.

example:

runonuithread(new runnable() {              @override             public void run() {                 \\this update view             }         }); 

where runonuithread method activity. if in fragment use getactivity().runonuithread call activity instance.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -