this is my main xml file.when i run my project it gives the expected out put.I have attached the screenshot too.But if i change the androidrientation to horizontal it shows blank screen.I have attached that screenshot too.Please advice.
I am very sure that others here would agree to it when i say, "You should take a good look at android docs or start reading a Good Android Beginner book before you post Questions here".As far as the Question is concerned its a Beginner's Mistake and happens because you have not paid attention to what the individual attributes in the xml Mean. All the Best
aruna sameera wrote:this is my main xml file.when i run my project it gives the expected out put.I have attached the screenshot too.But if i change the androidrientation to horizontal it shows blank screen.I have attached that screenshot too.Please advice.
When you change orientation, you need to save the screen's contents, or make a new layout file for horizontal/vertical assigning. Or -> Only the files with assigned ids -> android:id="@+id/button" for a view -> keep they look after the orientation change.
I too have the same question. I don't see why any of the views in the xml file should disappear just because you change the screen orientation. If it is just a very simple answer then a one liner will do Views having IDs assigned to them just means that the values they contain will be restored when the screen redraws in the new orientation? it doesn not explain why the screen is blank if you change orientation