Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old January 19th, 2012, 03:36 PM   #1 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 4
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default Android App and screen orientation

Hi, I was wondering if there was any java code that will allow you to make sure each window in your app stays in portrait despite the user flipping the phone to landscape. I already tried inserting android:screenOrientation="portrait" into both my android manifest and into every single XML file I had but unfortunately only some stayed in portrait and others still flipped to landscape. Please help and thanks!

jusjctin is offline  
Reply With Quote
Sponsors
Old January 19th, 2012, 04:32 PM   #2 (permalink)
Junior Member
 
Lemoncog's Avatar
 
Join Date: Feb 2011
Posts: 25
 
Device(s): HTC Desire HD
Thanks: 0
Thanked 6 Times in 2 Posts
Default

That is meant to be used within each activity you specify in your manifest.
Lemoncog is offline  
Reply With Quote
Old January 20th, 2012, 06:33 AM   #3 (permalink)
Member
 
Join Date: Jun 2010
Posts: 363
 
Device(s): Samsung Galaxy S (international)
Thanks: 72
Thanked 57 Times in 55 Posts
Default

your manifest should look like this
Code:
<activity
            android:name=".HList"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".Info"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".MapPage"
            android:screenOrientation="portrait" >
__________________
if I ever said anything that helped you , the thanks button is where your cursor/finger should head to
JiMMaR is offline  
Reply With Quote
Old January 20th, 2012, 08:15 AM   #4 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 4
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by JiMMaR View Post
your manifest should look like this
Code:
<activity
            android:name=".HList"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".Info"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".MapPage"
            android:screenOrientation="portrait" >

Ooooooh, ok. Thanks! I thought you had to do that in each individual XML file. I will go back and do this in the manifest instead. Thanks Lemoncog and JiMMar!
jusjctin is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 12:08 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo