我已經看過這個地方的圖片,但從某個時候回答的地方通常是「這是一個Android 2.3的已知問題」我使用4.4,所以這是肯定的不是答案。Android模擬器旋轉,但應用程序不重繪
我有關於最簡單的程序:「你好,Android」。當我啓動模擬器時,它將以縱向模式加載。使用Fn-Ctrl-F11(Mac),模擬器旋轉到橫向模式。但應用程序和電話控件不會重新繪製 - 整個事物只是側面看。
這裏的清單:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.helloandroid"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.test.helloandroid.Hello"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
和活動的XML文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Hello" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</LinearLayout>
我使用Eclipse,ADT的捆綁包構建v22.3.0-887826建設,雖然我不能想象一下這件小事情是重要的。
我的模擬器用於設備Galaxy Nexus,Android 4.4 API級別19.我試過這個硬件鍵盤存在標記和未標記。我找到了一個我從未見過的「鍵盤蓋支持」設置的參考 - 這個評論是從3/12 &,所以可能已經過時了。
這是我的第一個Android應用程序,所以我在這個環境中調試時是一個完整的新手。 TIA對我失蹤的任何建議。
編輯:添加代碼hello.java
package com.test.helloandroid;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class Hello extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.hello, menu);
return true;
}
}
當方向更改活動被破壞並重新創建時。 – Raghunandan
郵政編碼爲'Hello.java' –
發佈您的代碼您好。java –