删除列表查看页脚单击侦听器

列表视图页脚

RelativeLayout listFooterView = (RelativeLayout) inflater.inflate(
            R.layout.my_footer_layout, null);
getListView().addFooterView(listFooterView);

ListView OnClickListener

listView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1,
                int position, long id) {
            // TODO Auto-generated method stub
            Intent i = new Intent(getApplicationContext(),
                    Abc.class);
            startActivity(i);

        }
    });

单击监听器工作,即使我单击页脚视图。如何禁用页脚的点击事件。

提前致谢


答案 1

尝试使用此功能添加页脚:addFooterView(视图 v、对象数据、布尔值 isselectable)

试试下面这样:

RelativeLayout listFooterView = (RelativeLayout) inflater.inflate(
            R.layout.my_footer_layout, null);
getListView().addFooterView(listFooterView,null,false);

答案 2

推荐