私はこれを私の活動のレイアウトとして設定しようとしています:
<?xml version="1.0" encoding="utf-8"?>
<include layout="@layout/map_activity_base" />
@layout/map_activity_base
含める代わりに使用すると機能します。私がそうしない理由は、大画面のレイアウトに小画面のレイアウトのコンテンツを含めることができないためですが@layout/map_activity_base
、別のレイアウトのコンテンツが必要です。
私が得るエラーは
E/AndroidRuntime(11383): FATAL EXCEPTION: main
E/AndroidRuntime(11383): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.l_one.app.achileo/de.l_one.app.achileo.Main}: android.view.InflateException: Binary XML file line #2: Error inflating class include
[...]
E/AndroidRuntime(11383): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class include
[...]
E/AndroidRuntime(11383): Caused by: java.lang.ClassNotFoundException: android.view.include in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/de.l_one.app.achileo-1.apk]
<include />
だから、アンドロイドはそうなるはずだと思っているようですが、それは私が周囲なしView
で使用した場合にのみ起こります<include />
View
それで<include />
、周囲なしで使用することは可能View
ですか?そうでない場合、私が望むものを達成するための最良の方法は何ですか?
ところで:それが重要かどうかはわかりませんが、これは図書館プロジェクトの内容です。
編集:map_activity_base.xml
<?xml version="1.0" encoding="UTF-8" ?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView android:id="@+id/listHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:gravity="center"
android:text="@string/listHeader"
android:padding="5dp" />
<View android:id="@+id/divider"
android:layout_width="100dp"
android:layout_height="1dp"
android:background="#333"
android:layout_below="@id/listHeader" />
<de.l_one.app.map.base.POIListView android:id="@+id/poiList"
android:layout_width="100sp"
android:layout_height="match_parent"
android:divider="#cccccc"
android:dividerHeight="1dp"
android:layout_alignParentLeft="true"
android:layout_below="@id/divider"
android:listSelector="@android:color/transparent" />
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@id/poiList"
android:clickable="true"
android:apiKey="@string/googleAPIKey" />
<TextView android:id="@+id/cmtryNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:padding="5dp"
android:background="@drawable/cmtry_txt_view_back" />
<TextView android:id="@+id/navigate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/cmtryNameTextView"
android:padding="5dp"
android:background="@drawable/cmtry_txt_view_back"
android:visibility="gone"
android:text="@string/navigate" />
</RelativeLayout>