0

I have four.java class files:

  1. FragmentActivity that contains a View Pager.
  2. BlankFragment, testing purpose only.
  3. CameraFragment.
  4. CameraPreview.
    My question is, how do I get display rotation from my FragmentActivity into CameraPreview class?

Example: This doesn’t work....

int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();
Sufian
  • 6,405
  • 16
  • 66
  • 120
JimsAndroid
  • 1
  • 1
  • 1
  • Can you explain what you mean by it does not work? – Dishonered May 01 '17 at 03:33
  • I am attempting to pass `Context` from my `FragmentActivity`that contains the `ViewPager`, to the `CameraPreview` class, in order to obtain device orientation. I found the answer here, (http://stackoverflow.com/questions/9723106/get-activity-instance). – JimsAndroid May 20 '17 at 02:24

0 Answers0