画面の左側に画像があり、右側にコメントを書き込む場所があるアプリケーションを構築しようとしています (テキストビューを動的に割り当てます)。Linearlayout を Relativelayout 内に配置しようとしたときにエラーが発生しました。
以下は私のxmlファイルコードです(いくつかのボタンを差し引いたもの):
<RelativeLayout 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<com.example.blueprintproj.PaintView
android:id="@+id/paintView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/loadButton"
android:background="@drawable/bp2" />
<Linearlayout
android:id="@+id/linearLayout"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" >
<EditText
android:id="@+id/editText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add+"
/>
</Linearlayout>
以下は、実行しようとしたときに表示されるエラー メッセージです。
07-10 02:35:50.207: E/AndroidRuntime(786): FATAL EXCEPTION: main
07-10 02:35:50.207: E/AndroidRuntime(786): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.blueprintproj/com.example.blueprintproj.MainActivity}: android.view.InflateException: Binary XML file line #80: Error inflating class Linearlayout
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.os.Looper.loop(Looper.java:137)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-10 02:35:50.207: E/AndroidRuntime(786): at java.lang.reflect.Method.invokeNative(Native Method)
07-10 02:35:50.207: E/AndroidRuntime(786): at java.lang.reflect.Method.invoke(Method.java:511)
07-10 02:35:50.207: E/AndroidRuntime(786): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-10 02:35:50.207: E/AndroidRuntime(786): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-10 02:35:50.207: E/AndroidRuntime(786): at dalvik.system.NativeStart.main(Native Method)
07-10 02:35:50.207: E/AndroidRuntime(786): Caused by: android.view.InflateException: Binary XML file line #80: Error inflating class Linearlayout
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
07-10 02:35:50.207: E/AndroidRuntime(786): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.Activity.setContentView(Activity.java:1881)
07-10 02:35:50.207: E/AndroidRuntime(786): at com.example.blueprintproj.MainActivity.onCreate(MainActivity.java:42)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.Activity.performCreate(Activity.java:5104)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
07-10 02:35:50.207: E/AndroidRuntime(786): ... 11 more
07-10 02:35:50.207: E/AndroidRuntime(786): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.Linearlayout" on path: /data/app/com.example.blueprintproj-1.apk
07-10 02:35:50.207: E/AndroidRuntime(786): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-10 02:35:50.207: E/AndroidRuntime(786): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-10 02:35:50.207: E/AndroidRuntime(786): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.createView(LayoutInflater.java:552)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:643)
07-10 02:35:50.207: E/AndroidRuntime(786): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
07-10 02:35:50.207: E/AndroidRuntime(786): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
私が何を間違えたのか、または問題を指摘する必要がある他の情報がある場合はお知らせください。
どうもありがとう!