java应用程序已在Android Emulator Eclipse中停止
在Eclipse上的模拟器上查看我的Android应用程序时,我似乎有点问题。当应用程序准备运行时,我收到一条消息:
Unfortunately App Name has stopped.
代码如下:
<FrameLayout xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
xmlns:tools="http://schemas.安卓.com/tools"
安卓:id="@+id/container"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
tools:context=".MainActivity" >
<TabHost
安卓:id="@安卓:id/tabhost"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent" >
<LinearLayout
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
安卓:orientation="vertical" >
<TabWidget
安卓:id="@安卓:id/tabs"
安卓:layout_width="match_parent"
安卓:layout_height="wrap_content" >
</TabWidget>
<FrameLayout
安卓:id="@安卓:id/tabcontent"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent" >
<LinearLayout
安卓:id="@+id/tab1"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent" >
<Textview
安卓:id="@+id/textview1"
安卓:layout_height="wrap_content"
安卓:layout_width="fill_parent"
安卓:text="Welcome to Ambius" >
</Textview>
</LinearLayout>
<LinearLayout
安卓:id="@+id/tab2"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
安卓:id="@+id/tab3"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent" >
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</FrameLayout>
# 1 楼答案
为了使选项卡工作,您还需要java文件中的一些代码
查看以下示例:
启用LogCat go窗口>;显示视图>;LogCat(如果不可见,请按Other…将其分组在Android下)