-1

I have many layouts but I want to use the same landscape layout for all the Activities without copying all the layouts in the landscape folder. Is there a way to do this?

joao2fast4u
  • 6,868
  • 5
  • 28
  • 42
user3398380
  • 39
  • 2
  • 8

1 Answers1

0

I solved that way

if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
            setContentView(R.layout.oak);

     }else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){
                setContentView(R.layout.activity_main);
     }
user3398380
  • 39
  • 2
  • 8