I want to change screen orientation for each fragment independently in my app (i.e. fragment A is landscape only and fragment B is portrait only) just like I can do that for activities using AndroidManifest.xml.
When I create my fragments I pass a scecific screen orientation constant for each fragment using Fragment.setArgunents(..).
This link provide a visualization of the lifecycle for activity and fragment.
But it didn't really mention the full lifecycle when fragment is being triggered from an activity.
Can someone please explain what is the sequence of method will be triggered (both fragment and activity) when users change the device orientation?
Will this be the sequence:
I'm trying to add a fragment to an activity after the content view in the activity has been set. I'm not using the compatibility package and have my target API set to 16. I'm expecting the activity to be set to the fragments layout after the setContentView method in the main activity but on runtime, the fragment is never added and the screen in blank.
I'm just now learning android, and I have an application that has the main activity add a fragment on startup using the fragment manager. The program then switches between two fragments to perform its function using, again, the fragment manager to replace fragments.
I want this app to display the two fragments together when on a large screen.