android模拟程序崩溃,当我尝试在模拟器中加载它时,Android应用程序崩溃

我对Android编程非常陌生并且开始时起步不错。我已经为程序创建了一个通用UI,并没有更改任何实际的Java代码。每当我尝试在模拟器中加载应用程序只是为了查看它的外观时,应用程序崩溃了。有没有人知道为什么会发生这种情况?

另外,我从教程制作的其他应用程序工作得非常好,只是我最近创建的布局不起作用。

这是Java代码

package com.nubs.tableposv0_1;

import android.app.Activity;

import android.os.Bundle;

public class TablePOSv0_1Activity extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

}

}

这是更新的XML代码

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="horizontal"

android:weightSum="5"

>

android:layout_height="fill_parent"

android:layout_width="fill_parent"

android:layout_weight="1"

android:orientation="vertical"

>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 1"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 2"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 3"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 4"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 5"

/>

android:layout_height="fill_parent"

android:layout_width="fill_parent"

android:layout_weight="1"

android:orientation="vertical"

>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 6"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 7"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 8"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 9"

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="Item 10"

/>

android:layout_height="fill_parent"

android:layout_width="fill_parent"

android:layout_weight="3"

android:orientation="vertical"

android:weightSum="9"

>

android:id="@+id/items_table"

android:layout_width="fill_parent"

android:layout_weight="4"

>

android:layout_width="fill_parent"

android:orientation="horizontal"

android:layout_weight="1"

android:weightSum="3"

>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="1"

/>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="2"

/>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="3"

/>

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="horizontal"

android:layout_weight="1"

android:weightSum="3"

>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="4"

/>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="5"

/>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="6"

/>

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="horizontal"

android:layout_weight="1"

android:weightSum="3"

>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="7"

/>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="8"

/>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="9"

/>

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="horizontal"

android:layout_weight="1"

android:weightSum="3"

>

android:layout_weight="2"

android:layout_height="fill_parent"

android:text="0"

/>

android:layout_weight="1"

android:layout_height="fill_parent"

android:text="."

/>

android:layout_weight="1"

android:layout_width="fill_parent"

android:text="Total"

/>

logcat的:

07-22 01:24:41.793: ERROR/AndroidRuntime(392): at android.app.Activity.setContentView(Activity.java:1647)

07-22 01:24:41.793: ERROR/AndroidRuntime(392): at com.nubs.tableposv0_1.TablePOSv0_1Activity.onCreate(TablePOSv0_1Activity.java:15)

07-22 01:24:41.793: ERROR/AndroidRuntime(392): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)

07-22 01:24:41.793: ERROR/AndroidRuntime(392): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

07-22 01:24:41.793: ERROR/AndroidRuntime(392): ... 11 more

07-22 01:25:41.482: ERROR/DefContainer(224): Couldn't copy file: /data/local/tmp/TablePOSv0_1.apk

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值