Android 应用程序意外停止FrameLayout+;图片框
我正在尝试使用ImageView练习框架布局。当我构建代码时,没有任何错误。但当我尝试使用AVD安卓2.2运行它时,程序无法运行 说明“应用程序框架布局(process.com.framelayout)意外停止。请重试” 这是我的代码:Android 应用程序意外停止FrameLayout+;图片框,android,imageview,android-framelayout,Android,Imageview,Android Framelayout,我正在尝试使用ImageView练习框架布局。当我构建代码时,没有任何错误。但当我尝试使用AVD安卓2.2运行它时,程序无法运行 说明“应用程序框架布局(process.com.framelayout)意外停止。请重试” 这是我的代码: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#FFFFFF"
>
<TableRow>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:src = "@drawable/pict01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:src = "@drawable/pict02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</FrameLayout>
</TableRow>
<TableRow>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:src = "@drawable/pict03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:src = "@drawable/pict04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</FrameLayout>
</TableRow>
</TableLayout>
尝试此操作以获取错误消息:
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
try
{
setContentView(R.layout.main);
}
catch(Exception e)
{
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle("error message");
dialog.setMessage(Log.getStackTraceString(e));
dialog.create().show();
}
}
请发布完整的堆栈跟踪。并显示您的JAVA类。我在哪里可以找到它?很抱歉,我是新手,你的类代码和你的日志猫。你是说类代码是framelayout.java吗?我在哪里可以找到我的航海日志?我正在使用netbeans IDE 8.0.2。很抱歉问了一个很基本的问题