• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 android:orientation 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]
 
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 android:orientation 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.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic