NOTE: attach of thread 'Binder Thread #3' 错误

gaohongijj 2012-04-04 03:25:42
本人写了个ListView的测试程序,但最终结果显示不出来,用logcat提示:
04-04 07:14:26.308: INFO/AndroidRuntime(337): NOTE: attach of thread 'Binder Thread #3' failed
04-04 07:14:28.218: INFO/ActivityManager(60): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=gao.ListView/.ListViewTest }
04-04 07:14:28.278: INFO/AndroidRuntime(345): NOTE: attach of thread 'Binder Thread #3' failed
我写的代码如下:
ListViewTest.java代码:
(1)package gao.ListView;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.SimpleAdapter;

public class ListViewTest extends ListActivity {

public void onCreate(Bundle savedInstanceState, String gao) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ArrayList< HashMap<String,String>> list = new ArrayList< HashMap<String,String>>();
HashMap<String,String> map1 = new HashMap<String, String>();
HashMap<String,String> map2 = new HashMap<String,String>();
HashMap<String,String> map3 = new HashMap<String,String>();
map1.put("user_name", "gao");
map1.put("user_ip","192.168.0.1");
map2.put("user_name", "yang");
map2.put("user_ip", "192.168.0.2");
map3.put("user_name","li");
map3.put("uaer-ip","192.168.0.3");
list.add(map1);
list.add(map2);
list.add(map3);
SimpleAdapter listAdapter=new SimpleAdapter(this, list, R.layout.user,
new String[]{"user_name","user_ip"},
new int[]{R.id.user_name,R.id.user_ip});
setListAdapter(listAdapter);
}

}

(2)main.xml代码:
<?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"
>
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="vertical"
></ListView>
</LinearLayout>

(3)user.xml的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10pt"
android:singleLine="true"
></TextView>

<TextView
android:id="@+id/user_ip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10pt"
android:gravity="right"
></TextView>

</LinearLayout>

小弟初学android,,请各位大侠帮忙,,,
...全文
605 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
kwapoong 2012-04-21
  • 打赏
  • 举报
回复
because your ListViewTest extends ListActivity, you should make sure the id of ListView in main.xml is "@android:id/list" not "@+id/android:list"
b87936260 2012-04-09
  • 打赏
  • 举报
回复
没看出有什么问题,程序崩溃了没?还是只是一片漆黑?贴更多log看看!
源码直接下载地址: https://pan.quark.cn/s/387d7c8f6289 在使用IE浏览器的过程中,偶尔会出现重置为默认配置操作未能顺利完成的现象。这种情况的发生可能源于多种因素,包括注册表项出现偏差、浏览器附加组件之间存在不兼容、操作系统授权设置不当或受到恶意程序影响等。针对这一挑战,我们可以通过一系列系统性的方法来逐一诊断和纠正。首先需要验证当前用户是否具备管理员级别的操作权限。在执行重置配置的操作时,必须确保IE浏览器是以管理员身份启动的。具体操作方式为,使用鼠标右键单击IE程序图标,并从弹出的菜单中选择“以管理员身份运行”这一选项。其次,应当检查是否存在恶意软件。恶意程序有时会非法修改浏览器的配置信息,从而阻碍重置过程的正常进行。用户可以借助Windows系统自带的Microsoft Safety Scanner进行检测,或者选择安装并使用第三方安全防护软件执行全面的系统扫描。紧接着,需要对浏览器的缓存数据以及Cookies文件进行清理。在IE浏览器界面中,通过访问“工具”菜单并选择“Internet选项”,然后在弹出的设置界面中,切换至“常规”标签页,并执行清除浏览历史记录的操作,此过程应包含Cookies和临时互联网文件。倘若上述步骤均未能解决问题,那么可以考虑禁用或移除那些可能引发冲突的浏览器附加组件。相关操作需要在“工具”菜单下找到并打开“管理加载项”,对可疑的插件进行禁用处理,并在浏览器重新启动后再次尝试执行重置操作。再者,修复IE浏览器相关的注册表配置也是至关重要的环节。注册表编辑器是一个功能强大的系统工具,任何不当的操作都可能导致严重的系统问题,因此在进行修改前必须创建系统还原点作为安全备份。用户可以通过按下“Win+R”组合...

80,490

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧