Issue
I'm trying to calculate the time elapsed in the execution of an AsyncTask, but nothing is logged in onPostExecute method, What I'm doing wrong?
Here is a part of my 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 is logged in LogCat
Log.d("TEMPO DE REQUISIÇÃO", String.valueOf(diffTime) + " milisegundos");
Solution
I solve the problem just going to project -> clean and now it is working.
Answered By - Danilo Silva
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.