我已经用XML写了一个应用程序,但我仍然没有用java代码编写类。但模拟器可以显示我的应用程序的名称,然后它说“不幸的是,应用程序已停止。”我要为这个问题做些什么??!错误在Android模拟器上运行应用程序
这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Textview
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/TextView2"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Button"
/>
</LinearLayout>
,它通常会产生某种MainActivity类别,即使你没有写Java代码。关于发生了什么,应该有一些Logcat输出,你可以发布吗? –
@Chad Campbell:java.lang.classLoader.loadClass(ClassLoader.java.501)at android.view.LayoutInflater.onCreateView(LayoutInflater.java:552) .... –
嗨@SetarehNaraghi。很好的问题 –