Friday, July 22, 2011

[android-developers] Re: fragment activity management

If Activity2 is started from Activity1 all you need to do is to finish
it to return to Activity1 where you get the layout you want. So in
Activity2.onCreate():

if (getResources().getConfiguration().orientation
== Configuration.ORIENTATION_PORTRAIT) {
finish();
return;
}

Dianne is doing this in the example at
http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
but for landscape in DetailsActivity.


On 21 Juli, 09:55, mol3ku3l3 <mol3ku...@gmail.com> wrote:
> Hello,
>
> I have application build with fragments. I have defined all fragments
> and layouts in xml.
> When screen is small or medium I've divided my UI to two different
> parts:
> |                  | |                  |
> | Fragment1  | | Fragment2 |
> | =Activity1   | | =Activity2  |
> |                  | |                 |
>
> But when the screen is large I want it to be displayed like that:
> in portrait mode:
> |                 |
> |Fragment1 |
> |                 |
> |Fragment2 |
> |                 |
> |                 |
>
> in landscape mode (large)- the same as smaller screen:
> |                  | |                 |
> | Fragment1 | | Fragment2 |
> | =Activity1  | | =Activity2  |
> |                  | |                 |
>
> My problem is when I am in landscape mode, fragment 2 (=activity2) is
> displayed and when I change the orientation to portrait, I would like
> to have portrait mode of the large screen but I get portrait mode of
> small/medium screen (so it is still activity2).
> I know that this is android activity management but it there any way
> that in this case I can display portrait mode after orientation change
> in large screen?
>
> Thanks for help.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment