Note that there are some explanatory texts on larger screens.

plurals
  1. POSet initial screen orientation
    primarykey
    data
    text
    <p>I am making an app where the first screen I want to view is Portrait. I then go to the next activity which is set in landscape. </p> <p>The problem i'm facing is that if I return to the first screen it will be set as landscape, evidently inheriting the orientation from the previous screen. </p> <p>Is there a possible way to set the initial screen orientation as portrait which is set but the user can then go ahead and change it to landscape when they want? </p> <p>Thanks </p> <p>EDIT: SOLVED</p> <p>Thank you for your suggestions. I've overcome the issue. It's slightly difficult to explain but will try my up most.</p> <p>So my first activity has a feature whereby if the phone is turned to landscape it will show an image, full screen. And again, if the phone was portrait, the portrait view, where I have a list view.</p> <p>The second activity loads an editing page to let me change that image. </p> <p>So now if i press back on the editor activity. The first activity would load into a list view in LANDSCAPE. which is NOT what I want.</p> <p>therefore in order to get around this. I have firstly disabled the back button when the first activity is landscape so the user can not remove himself from the view without turning the phone to landscape.</p> <p>I then moved the code:</p> <pre><code> @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { //Show landscape picture } } </code></pre> <p>to the top of my class before the onCreate method. </p> <p>This has solved my issue so that now, if I was to go back to my first activity whilst in landscape the only thing that would show is the landscape view.</p> <p>I hope that was clear enough for all to understand :)</p> <p>Again thanks for the help! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload