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() .....
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
Post a Comment