2012-12-13 7 views
5

Ich teste/Debuggen einer Android-App und obwohl ich gesetzt habenBildschirm auf den Kopf gestellt

configChanges="keyboardHidden|orientation" 
android:screenOrientation="portrait" 

und verwendet

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 

der Bildschirm den Kopf stellt. Dies scheint auf WXGA 4.0, 4.1, 4.2 zu erscheinen. Hat es etwas mit der API, dem Emulator oder etwas anderem zu tun? Ich stelle diese Frage, weil ich nichts Offizielles und Klares gefunden habe.
Vielen Dank.

PS: als Lösung, falls es ein API-Problem gibt, sollte ich überprüfen, ob es die Version ist und den Bildschirm drehen oder gibt es etwas Besseres?

+1

Danke Jungs für die Bearbeitung und Formatierung: D – gabi906

Antwort

4

HALLO Ich verwende diese für Landschaft

<activity 
    android:name=".MainActivity" 
    android:label="@string/title_activity_main" android:configChanges="orientation" android:screenOrientation="landscape"> 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 
</activity> 

und

<activity 
    android:name=".MainActivity" 
    android:label="@string/title_activity_main" android:configChanges="orientation" android:screenOrientation="portrait"> 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 
</activity> 

für Portrait- und sein wrking für mich android 4.1 Simulator

Verwandte Themen