【发布时间】:2012-10-22 15:52:16
【问题描述】:
在 Eclipse 的模拟器上检查我的 Android 应用程序时,我似乎遇到了一些问题。当应用准备好运行时,我收到一条消息:
很遗憾,应用名称已停止。
代码如下:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Textview
android:id="@+id/textview1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="Welcome to Ambius" >
</Textview>
</LinearLayout>
<LinearLayout
android:id="@+id/tab2"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:id="@+id/tab3"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</FrameLayout>
【问题讨论】:
-
这不是代码,在这里发布你的 onCreate() 方法以及 logcat 堆栈跟踪。
-
看起来这个问题被要求提供更多代码。因此它可以因为缺少 minimal reproducible example 而被关闭。
标签: java android eclipse android-tabhost android-tabs