我是android新手。我有一些Java知识,并且正在使用Eclipse。目前,我正试图在选项卡中显示地图,并正在寻找教程/代码来帮助我。:)
我已经看到了一些有关此错误的问题,但仍然无法弄清楚自己在做什么。我正在从这里使用代码:http : //vkroz.wordpress.com/2009/07/03/programming-android-%E2%80%93-map-view-within-tab-view/
我只是想念一些明显的东西吗?
运行时异常的值e:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: ... android.view.InflateException: Binary XML file line #24: Error inflating class <unknown>
Run Code Online (Sandbox Code Playgroud)
第24行就是 </LinearLayout>
整个main.xml:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:id="@+id/emptylayout1" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<TextView android:id="@+id/textview2"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:text="Details Details Details Details"/>
</FrameLayout>
</LinearLayout>
</TabHost>
Run Code Online (Sandbox Code Playgroud)
我的其余代码与链接相同,但我也将其粘贴到此处。
MapInTabActivity.java
package com.test.mapintab;
import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.TabHost;
import …Run Code Online (Sandbox Code Playgroud)