縦向きモードの画像を含むListViewと横向きモードの同じ画像を含むGalleryViewが必要なアプリケーションに取り組んでいます。res/layout-land/main.xml(Landscape)と通常のres/layout/main.xml(portrait)にフォルダを作成しましたしかし、私は例外を受けています
03-02 11:21:06.420: E/AndroidRuntime(775): FATAL EXCEPTION: main
03-02 11:21:06.420: E/AndroidRuntime(775): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.landscape/com.landscape.ListAvtivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.os.Handler.dispatchMessage(Handler.java:99)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.os.Looper.loop(Looper.java:130)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-02 11:21:06.420: E/AndroidRuntime(775): at java.lang.reflect.Method.invokeNative(Native Method)
03-02 11:21:06.420: E/AndroidRuntime(775): at java.lang.reflect.Method.invoke(Method.java:507)
03-02 11:21:06.420: E/AndroidRuntime(775): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-02 11:21:06.420: E/AndroidRuntime(775): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-02 11:21:06.420: E/AndroidRuntime(775): at dalvik.system.NativeStart.main(Native Method)
03-02 11:21:06.420: E/AndroidRuntime(775): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.ListActivity.onContentChanged(ListActivity.java:243)
03-02 11:21:06.420: E/AndroidRuntime(775): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:210)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.Activity.setContentView(Activity.java:1657)
03-02 11:21:06.420: E/AndroidRuntime(775): at com.landscape.ListAvtivity.onCreate(ListAvtivity.java:43)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-02 11:21:06.420: E/AndroidRuntime(775): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
03-02 11:21:06.420: E/AndroidRuntime(775): ... 11 more
そして、layout-land から main.xml を削除すると、アプリケーションは正常に動作し、ListView のみが表示されます。