Show Progress Dialog between threads?
Asked
Active
Viewed 399 times
1
-
could you also post the crash log? – Yashwanth Kumar Oct 19 '11 at 07:42
-
are you ensuring to terminate the previous asynctask when your activity is paused? – senola Oct 19 '11 at 07:46
-
are you using a tahhost inside a tabhost (or some kind of activity group) ? – senola Oct 19 '11 at 07:52
1 Answers
2
You should avoid using the getApplicationContext()
-method to get a Context
-object. There are better ways:
- If in an Activity, you can simply supply
this
- If in an inner-class of an Activity, you can supply
OuterClassName.this
- When in a Helper-class which needs a
Context
-object to create e.g. a View, supply aContext
-Object via the constructor and save it in a property.
Also see this similar question: Android: ProgressDialog.show() crashes with getApplicationContext

Community
- 1
- 1

Lukas Knuth
- 25,449
- 15
- 83
- 111