> > If i launch Inner main fragment 2 and i tap on anther next tab. when i > came back to the Home Tab, the Inner main fragment 2 is not visible and > it goes to the Home Tab automatically. >
It sounds like you have a bug. To fix it, you should probably put some breakpoints in your fragment's lifecycle callbacks and figure out why you are getting unexpected bhavior. Finally i fixed that issue using this code, > > <activity > android:name=".HomeActivity" > android:configChanges="orientation|screenSize" > android:label="@string/title_activity_operation" > > </activity> > > This is a very common approach to "fixing" errors, but it is generally a very very very bad idea. Unless you know what you are doing, you do not want to be using the configChanges attribute. But the problem is, i want to set deference layout with orientation change > (portrait/landscape) for a inner fragment in the main fragment. But It's > not working and orientation listener is not working in an inner fragment. > I'm not sure I fully understand what you are trying to say here... But what I think you are saying is that you have two layout files (one in res/layout and one in res/layout-land) but when you rotate the device the layout doesn't get reloaded. Is that correct? If so, I refer to my comment above... specifying configChanges for an activity is generally a very very very bad thing to do, unless you really know what you are doing. Your configChanges line above tells Android to ignore orientation events... So naturally, when you rotate the device, it ignores the fact that the orienation changed and the layout doesn't get reloaded. Remove that line, and then your layouts should magically work on device rotation. But... that will then bring back the other but you mentioned... so you will need to start doing some debugging to figure out why you are getting unexpected behavior. Already I've created two deference XML layouts (layout-large-land and > layout-land)for a single inner fragment. But the device when rotate UI not > change. How can i solve this issue. > See above... Also, as an FYI, if you provide some code of how you are loading the fragments, you might get some better info on how to solve your problem. Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Aug 28, 2014 at 10:45 PM, askl <[email protected]> wrote: > I've a Project Android Tab Pager with Fragments. And there're two inner > fragments in Main fragment. > > - Home Tab (Fragment) > - Inner main fragment 1 > - Inner main fragment 2 > - Next Tab 1 (Fragment) > - Next Tab 2 (Fragment) > > If i launch Inner main fragment 2 and i tap on anther next tab. when i > came back to the Home Tab, the Inner main fragment 2 is not visible and > it goes to the Home Tab automatically. Finally i fixed that issue using > this code, > > <activity > android:name=".HomeActivity" > android:configChanges="orientation|screenSize" > android:label="@string/title_activity_operation" > > </activity> > > But the problem is, i want to set deference layout with orientation change > (portrait/landscape) for a inner fragment in the main fragment. But It's > not working and orientation listener is not working in an inner fragment. > > Already I've created two deference XML layouts (layout-large-land and > layout-land)for a single inner fragment. But the device when rotate UI not > change. How can i solve this issue. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

