top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Android: Orientation change with fragment

+4 votes
460 views

I am having trouble with showing up fragments on orientation change. I have 2 fragments, one fragment handles the portrait mode and the another handles landscape mode. But the problem is that when I rotate from portrait to landscape then back to portrait again. It doesn't show the portrait fragment properly.

posted Jun 22, 2016 by Akshay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
better if you share your code,i can suggest you what you need to change else i am trying to ans in ans section of queryhome

1 Answer

+2 votes
 
Best answer

May be second activity that is showing only one fragment is re-created on orientation change.What you can do here is to check orientation in your onCreate, if portrait - launch Activity_1 with suitable intent so that it can start second frag for correct details.
I found one solution similar to your problem ,click on this link below
http://stackoverflow.com/questions/6741754/orientation-change-using-fragments-wrong-activity-start
and let me know if it is working properly.

answer Jun 26, 2016 by Shivam Kumar Pandey
thanks Akshay for selecting as best ans
Similar Questions
+2 votes

How to make TabActivity with fragment it should support below version 3 ?

+2 votes

I've been looking through the sources trying to figure out where it wakes up the screen when I connect and disconnect the charger. Please suggest some hint? I thought it might be NfcService, but I "froze" that service and it still wakes the screen.

0 votes

I want to change the default refresh of HDMI output property in my AOSP for S905X Tv (MQX) box. I think that package of my interest is /packages/apps/TvSettings.I need change value from default 1080p-60Hz to 1080p-50Hz.

I found HDMI_LIST with modes in OutputUiManager.java but here I am in the end.I did not find any default xml in values.

...