Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove ListView footer Click Listener

ListView Footer

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);

        }
    });

On Click Listener works even if I click on footer View. How to disable click event on for footer.

Thanks in Advance

like image 581
Varun Vishnoi Avatar asked Dec 30 '13 08:12

Varun Vishnoi


1 Answers

Try to add your footer with this function: addFooterView (View v, Object data, boolean isSelectable)

Try something like this:

RelativeLayout listFooterView = (RelativeLayout) inflater.inflate(
            R.layout.my_footer_layout, null);
getListView().addFooterView(listFooterView,null,false);
like image 71
Damien R. Avatar answered Oct 06 '22 07:10

Damien R.