解决方案 »
- 上传图片到服务器问题(.net 写的WebService)上传后的base64 解析不了
- android如何获取一个SD卡指定文件夹的图片Uri uri问题
- 求助:google play 上传apk乱码问题
- 求解:android手机代码实现手机关机
- 求助:一个Button的Listener
- android这种警告算什么?有类似的进来送分了
- android 长按listView 里的项可以弹出上下文菜单,如果实现单击也能弹出呢?
- 如何添加滚动条?
- android网络通信权限
- load(this,R.raw.click);R.raw错误
- Activity中显示多个listview
- 在android下,捕获 apk 安装的状态?
这句是多余的,list已经是成员变量了
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LayoutInflater _LayoutInflater = LayoutInflater.from(this);
View _View = _LayoutInflater.inflate(R.layout.main, null);
InitList(_View);
}
onCreate方法改为
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
InitList();
}
把InitList()中ListView _ListView = (ListView) _View.findViewById(R.id.lv_ls_Ent);
直接改为ListView _ListView = (ListView)findViewById(R.id.lv_ls_Ent);
这样你就可以进入getview方法了(之前根本都没进入getview方法,当然显示不了数据啊~~)
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
这句话去掉后,程序直接强制退出啊...
然后我不去掉并且,按你说的改了,还是显示不出来数据啊?
View _View = _LayoutInflater.inflate(R.layout.main, null);
没看懂要这个干啥,直接删掉
private MyAdapter(Context context)
{
this.mInflater = LayoutInflater.from(context);
}
在这个构造方法里面再传个参数list.都没看清你那个adapter是不是放在activity中的