1

Show Progress Dialog between threads?

user
  • 673
  • 1
  • 6
  • 10

1 Answers1

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 a Context-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