1

I sit with the problem. Here's the thing. I am writing an application to display pdf files.

The process of rendering files, runs parallel to the main stream. For very frequent turns the screen comes a time when all the objects in my class application become null.

how do I disable screen rotation and wait for the completion of rendering the page?

I tried used

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); setActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);

but in setting the screen SCREEN_ORIENTATION_SENSOR, the screen orientation is changed several times

alezhka
  • 738
  • 2
  • 12
  • 29
  • Could you please post a stack trace? – blacharnia May 04 '12 at 14:37
  • Unable to start activity ComponentInfo{com.package.name/com.package.name.MainActivity}: java.lang.NullPointerException Error due to the fact that the variables class Application are losing their links. This occurs at a very rapid and frequent changes screen orientation. – alezhka May 05 '12 at 07:55
  • Can I put a delay on the change of orientation of the screen? – alezhka May 05 '12 at 07:56

1 Answers1

2

Here is the same question, the different answers work for one activity or the entire app: How to disable orientation change in Android?

Community
  • 1
  • 1
Sam
  • 86,580
  • 20
  • 181
  • 179