Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when i change android:orientation to horizontal it shows blank screen

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Vertical.jpg
[Thumbnail for Vertical.jpg]
Horizontal (1).jpg
[Thumbnail for Horizontal (1).jpg]
 
zoheb hassan
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
D Hagy
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
james frain
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic