3
I’m using the method for when change of layout change position but when start application in landscape it starts layout teste_01 landscape mode being that its format is portrait how to fix it.
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
setContentView(R.layout.activity_teste_02);
inicializarInterface();
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
setContentView(R.layout.activity_teste_01);
inicializarInterface();
}
@Rodolfo is just an example! You need to implement the layout ( .xml file) you created.
– rsicarelli
@Rodolfo what file name . xml you created in each folder?
– rsicarelli
@Rodolfo well. After having created his
activity_teste.xml
in the briefcaselayout-land
and/or in the folderlayout-port
, in hisActivity
placesetContentView(R.layout.activity_teste);
– rsicarelli
thanks already found my mistake
– Vale
@Rodolfo great! I advise to give a read/ studied on how the folder works
res
Android so you can use its full potential– rsicarelli
I have a question if you think it best I open another question how to do not stay Initiating when changing from landscape layout to portrait and vice versa type, stay in fashion waiting I do not know if I got to understand.
– Vale
@Rodolfo could not understand. Open another question and better detail the question with what you need please
– rsicarelli
I have already published a new question.
– Vale