1

in my app I get data while a ProgressDialog is shown. Now I want to keep the current screen rotation (Landscape/Portrai) while the ProgressDialog is shown to prevent some errors. After the process is finished I want to "releace" the app and enable the screen rotation.

How do I do this?

DominikTV
  • 354
  • 2
  • 5
  • 18
  • better to get orientation before you start progressbar and set that in setoreientation method using if/else. – Pankaj Arora Jan 28 '15 at 13:48
  • `keep the current screen rotation to prevent some errors` sounds ridiculously ... better fix em in another way – Selvin Jan 28 '15 at 13:48
  • @Selvin I create a "big" list and on some older phones, this needs some seconds and if they turn the device I get 'java.lang.NullPointerException' – DominikTV Jan 28 '15 at 13:52

1 Answers1

0

Add the orientationChange to intercepted activity config changes (in the manifest), then override onConfigurationChanged() and simply call super.onConfigurationChanged(newConfig); when your progress bar is running

See this answer: you'll only need to apply this behaviour when yourprogressbar.isVisible() is true

Community
  • 1
  • 1
Shine
  • 3,788
  • 1
  • 36
  • 59