How to BACK from second screen to first screen when device rotate 90 degree in android cardboard?

291 Views Asked by At

I am trying to develop an sample cardboard app in android. In that I am switching from First screen to Second screen, and i have done that successfully.

But when i am trying to BACK from second screen to first screen i don't know how to do that. I have gone through some of the links but didn't get success.

I want to go back to first screen from second screen when device get 90 degrees rotated as it is doing in most cardboard apps on play-store.

Can any one guide me how can I achieve this kind of functionality? Tutorials, links, explanations, anything?

Any help will be appreciated.

1

There are 1 best solutions below

0
On

Actually, you don't need two screens , you need to update the layout when you rotate your screen .use two xml layout for the same activity. you need to handle screen change in onConfigurationChanged method.here is a full explanation on how to achieve it http://www.codeproject.com/Articles/422431/Handling-screen-layout-changes-in-Android