Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android layout-land and screen-rotation handling

I have layouts for portrait mode (in folder layout) and for landscape one (in the folder layout-land). This screen is located under one of the tabs, so I had to handle screen rotating (after screen has been rotated, no default screen restart occurs).

I would like to update view from 'layout-land' when screen rotates to landscape mode and from 'layout' when screen rotates to portrait one.

How can I do this?

like image 952
davs Avatar asked Jan 12 '11 17:01

davs


1 Answers

You can use onConfigchange method in that setContentView(R.layout.name) this way will work.

like image 175
Anand Avatar answered Sep 27 '22 17:09

Anand