• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to show dialog after background task of asynctask finishes

 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI;

iam trying to do upload thing iun background of my asynctask task...i want to show a message dialog telling the user that he has uploaded successfully which shud appear after my uploading...
i tried this in postexecute()

and the log cat says:


please help
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently there is a method call on a null reference, locate that line.
 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to know how to call a new activity after background task. and the way i did is correct???
 
Mohan Prasath
Ranch Hand
Posts: 38
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have to check the "context" try using getApplicationContext() instead.
 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no that is not possible getApplicationContext() doest wrk here......please some one help
 
Tim Moores
Bartender
Posts: 3129
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the result of you doing this:
Hussein Baghdadi wrote:Apparently there is a method call on a null reference, locate that line.
 
Mohan Prasath
Ranch Hand
Posts: 38
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suzzane Pinto wrote:no that is not possible getApplicationContext() doest wrk here......please some one help


If you are writing the above mentioned code in your question is within an activity then you can access the get Application Context method using the this keyword.
try this.getApplicationContext(). If the onPostExecute method is not within an Activity then you have to pass the context explicitly to your function.
 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankyou mohan!!
 
Mohan Prasath
Ranch Hand
Posts: 38
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic