File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes when i change  android:orientation to horizontal it shows blank screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "when i change  android:orientation to horizontal it shows blank screen" Watch "when i change  android:orientation to horizontal it shows blank screen" New topic
Author

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

sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1087
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.



[Thumbnail for Vertical.jpg]

[Thumbnail for Horizontal (1).jpg]

zoheb hassan
Ranch Hand

Joined: Apr 01, 2009
Posts: 152

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

Joined: Jul 05, 2011
Posts: 12
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

Joined: Apr 06, 2011
Posts: 36
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when i change android:orientation to horizontal it shows blank screen