Android Emulator 4.4 apparently has a bug which keeps it from changing rotation appropriately. Having heard that Bluestacks is faster anyway, I wanted to give it a shot, but I can't find a way to change my orientation while in my app. My app launches in the full tablet-sized screen of Bluestacks and that's that. The system tray options don't help. I want Bluestacks to look and behave like a standard android phone, with the ability to rotate.
It looks like other versions of Bluestacks have had a rotation button (and other buttons)? I find references to this, but it's not in the latest version I downloaded. Any ideas?
Using the icon on the system tray, setting it to enabled worked for me.
You also have to check if you are forcing the portrait orientation on your manifest. I had to put the tag on every Activity tag, not on the application tag. Like this:
<activity android:name="com.example.LoginActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.MainActivity"
android:screenOrientation="portrait">
</activity>
Related
I'm making activity which should always remain in one orientation on all devices, preferably portrait.
here is my activity
<activity
android:name="com.example.app.Settings"
android:label="#string/settings_activity_title"
android:autoRemoveFromRecents="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
It works on phone devices but when I tested on virtual tablet it didn't.
I test on Nexus 9 in Android Studio and made my own device with dimensions 2500x2500, screen size 9in.
In such cases, screen will still rotate.
I have also tried setting orientation programmatically inside onCreate method but it didn't help.
I tried to find any information regarding this problem but couldn't.
My question is if this is related to android studio emulator, or this can happen on physical device
I have application with screen rotation.
rotating mechanism i handle with configChanges:
<activity
android:name=".ui.activity.MainActivity"
android:label="#string/app_name"
android:configChanges="orientation|screenSize"
android:screenOrientation="fullSensor"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Problem:
When user turn off screen, rotate device on 90 degrees and unblock it screen start with "old" orientation of my app, it look ugly.
here scheme:
after block and rotate i get this
blink and app come to normal
try it on Nexus 5(android v5) and Nesus 10(android v4.4), at phones all works fine
Adding android:configChanges="orientation|screenSize" tells the system that you are going to handle these config changes yourself, and for the system to not do anything about it.
By removing them, your activity will be recreated with the correct layouts when you rotate.
If you're using configChanges to avoid the activity being recreated, I feel bad for you son.
I am having an android app developed and the developer sent me the .APK file so I can test the first version. I have successfully installed the .APK file on my Android device. However, when I run it, the app shows the name of each activity (with the app's logo) at the top, as shown in the following link http://www.quickid.net/activity.JPG (StackOverflow won't let me post images without a level 10 reputation). The left picture shows the MainActivity, and the right picture shows the startTrail activity. So, what's up with that? Is it some kind of test mode? How can I run the app as it would normally be run as if it were downloaded from the Play store, without it showing the activity names at the top? Also, when the app puts text in the notification bar, it says "Rolling text on statusbar" before showing the text.
That is the ActionBar, if the developer does not want to use it, he must change the default theme to Theme.Holo.NoActionBar or another that hides the action bar.
At the top of most activities is the activity's label. This is set in the App Manifest (AndroidManifest.xml). In <activity> you can add the attribute android:label.
By default it looks so:
<activity android:name=".Activity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If you want to change the label, add a String value, and put this to android:label. If you want no label, add android:theme="#android:style/Theme.NoTitleBar". So it looks like this:
<activity android:name=".Activity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I'm attempting to react to a size change in my app. Or more specifically I'm trying to figure out when the keyboard shows up.
I've tried #Override ... onSizeChanged() of the main windows (a RelativeLayout view extension)
It gets called when I change the orientation, but not when I show/hide the keyboard.
My layout is not scrolling, so the controls at the top of my screen fall out of view, and the only way to get them back is to hide the keyboard.
I've read a pile of other sites and googled the snot out of this one, but it has me befuddled.
Oh.. I'm on a 2.1 (aka 7) build of android, and I'd like to be able to run the app on my own phone :)
Oh.. so the question. How do I catch something resembling onSize on an android device.
Try to add below to related activity in manifest.xml
android:windowSoftInputMode="adjustPan"
For Example
<activity android:name=".SignUp"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.ACTIVITY" />
</intent-filter>
</activity>
This question already has answers here:
How can I rotate display only in landscape mode in android?
(4 answers)
Closed 6 months ago.
I am working in an android application in 2.2 and I want to set my application in landscape mode.
For that I added in my manifest with every activity tag android:screenOrientation="landscape" and it worked fine.
But it comes only in one side. If I turn the device again upside down it fit in the same position in landscape mode. How can I have landscape mode in both the side of the device. Please help me.
Thanks in advance.
Try this
android:screenOrientation="reverseLandscape"
To get an Android application to display in landscape mode only, add this line to your Activity definition in the AndroidManifest.xml file:
android:screenOrientation="landscape"
For example, this is the definition for my main activity in the Android manifest file:
<activity
android:name=".MainActivity"
android:screenOrientation="landscape"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Using this, I think it will help you
addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChange);
function onOrientationChange(event:StageOrientationEvent):void {
trace("onOrientationChange:"+event.afterOrientation);
...and process result.
}
}