Change XML Layout automatically when orientation happens
Most of Android developers know that Android has lots of unique and useful features. One of them is changing the layout based on current orientation. But it seems that it is not easy to manage what to do before and after changing the layout. Before manage/control the layout, you must have two layouts, landscape (in layout-land/ folder) and portrait (in layout/ folder). Then, we start to manage/control the layouts. If you don't want to manage/control all stuffs, just let Android do it for you, by doing: Remove android:configChanged="orientation" of your activity. This will cause that you don't receive onConfigurationChanged event. By doing this, there are some pros and cons: Pros: Android will reset the ContentView when onConfigurationChanged (we can't see it anymore). We just prepare the layouts easily. Cons: All parameters/properties will be reset when Android resets the ContentView. In the first step, it is hard to ...