Reputation: 51
I have a menu with fragments instead of activities. Each fragment is full screen when is called. I want to be able to make for fragment1 - orientation portrait, fragment 2 - orientation landscape etc.. For activities is easy beacuse i can change them in the manifest, but how can i do on fragments?
Upvotes: 1
Views: 445
Reputation: 157447
Inside the onCreate
of each fragment
you have to call
getActivity().setRequestedOrientation(requestedOrientation)
that's will set the orientation of your Activity
(se the Fragment
orientation) to requestedOrientation
. This is the only way. Fragment itself can not manage its orientation
Upvotes: 2