java - Android AsycTask ellapsed time calculation -
i'm trying calculate time ellapsed in execution of asynctask, nothing logged in onpostexecute method, i'm doing wrong?
here part of code:
@override protected void onpreexecute() { this.dialog.setmessage(mensagem); this.dialog.show(); date date = new date(); starttime = date.gettime(); } @override protected void onpostexecute(string result) { if(this.dialog.isshowing() && this.dialog != null) this.dialog.dismiss(); date date = new date(); endtime = date.gettime(); long difftime = endtime - starttime; //here nothing logged in logcat log.d("tempo de requisiÇÃo", string.valueof(difftime) + " milisegundos");
- check logcat level, @
debug
. - make sure not cancelling
asynctask
while running otherwiseonpostexecute
won't run. - also if being run in
service
there maybe issueslooper
not being set ifasynctask
not running. - try changing "tempo de requisiÇÃo" "tempo de requisicao" might logcat not support character encoding.
Comments
Post a Comment