java android编程

[复制链接]
查看11 | 回复3 | 2010-8-6 13:57:54 | 显示全部楼层 |阅读模式
ArrayAdapter directoryList = new ArrayAdapter(this,android.R.layout.simple_list_item_1, list);


setListAdapter(directoryList);
提示错误:
The method setListAdapter(ArrayAdapter) is undefined for the type fileread
我是java新手,请高手指点呀!
移到这一行,按ctrl+1 选“add this method" ,就又创建了private void setListAdapter(ArrayAdapter directoryList) 这个函数,可这函数是系统的。 而且也添加jar包的。

回复

使用道具 举报

千问 | 2010-8-6 13:57:54 | 显示全部楼层
你的这个类的父类是什么?确定是ListActivity吗?如果不是,直接调用setListAdapter肯定是这样的提示,你可以用ListView的对象来调用,就没问题了
回复

使用道具 举报

千问 | 2010-8-6 13:57:54 | 显示全部楼层
表示不懂android
回复

使用道具 举报

千问 | 2010-8-6 13:57:54 | 显示全部楼层
移到这一行,按ctrl+1 选“add this method"
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行