Orientation change Help

rfresh

Well-Known Member
Licensed User
Longtime User
I have two Activities in my small app, Main and Setup. When I touch a button on Main to display the Setup screen, I'm doing this in portrait. While in Setup screen I rotate into landscape mode and the Main screen displays, in landscape.

What is causing this and how can I get the orientation change to remain on the Setup activity?

Thanks...
 

rfresh

Well-Known Member
Licensed User
Longtime User
You should set the Main Activity to portrait only and the Setup Activity to landscape only, in the IDE menu Project / Orientations Supported.

Best regards.

I don't understand why I would want to do that. I want both of my Activities to be able to use portrait and landscape orientations.
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
Can you post your code.....? It's easier to see the whole picture.

Tom, I have 3 modules (Main, Setup and Code) and before I post that code which is still a fair amount, my basic question really is this:

When viewing the screen in one Activity, in portrait mode, and you then manually change to landscape mode, what can cause another Activity to display?

I would have thought that if I was in my Setup Activity it would stay in that Activity no matter how many times I turned the phone to portrait and landscape and back again, etc.

Apparently, something else is triggering the Main Activity .Create/Resume modes while I'm in my Setup Activity yes?
 
Upvote 0

Tom Christman

Active Member
Licensed User
Longtime User
"While in Setup screen I rotate into landscape mode and the Main screen displays, in landscape."
Are you saying you're rotating the phone/pad? Because this would indeed cause the orientation to change (a normal condition when you have not defined a preferred orientation). Again code would help, but if you wish to retain the normal orientation change when rotating the device, your problem is unclear!
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
Orientation change causes a pause/resume condition. Do you have code to service this change?
Tom

Tom, I checked my Pause function and I had (don't know why) an Activity.Finish in there so that's why the Setup screen didn't display in landscape when I manually rotated the phone.

I removed it and it now seems to work fine.

Thanks again to you and Klaus.
 
Upvote 0
Top