Q: how to add some listener on particular item in listview in android? I have a listview in which i have 4 item and I have a class which contain some listner implementation what I want when I click item at poition 1 I want to add that listener class instance.how can I do that
code:-
m_OfferList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
            switch (position){
                case 1:

                    MonetizationManager.createSession(getActivity(), "91707", this);


                    MonetizationManager.setRewardListener(getActivity());
            }
        }
    });

here I want to set listener in specific index 

A: case 0: will be first position of list you are you logic at case 1: 
m_OfferList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
            switch (position){
                case 0:

                  // First item Clicked
                    MonetizationManager.createSession(getActivity(), "91707", this);
                    etizationManager.setRewardListener(getActivity());
                 break;
                case 1:
                  // 2nd item Clicked
                    MonetizationManager.createSession(getActivity(), "91707", this);
                    etizationManager.setRewardListener(getActivity());
                 break;
                 case 2:
                    // 3rd item Clicked
                    MonetizationManager.createSession(getActivity(), "91707", this);
                    etizationManager.setRewardListener(getActivity());
                 break;
                  case 3:
                    // 4th item Clicked
                    MonetizationManager.createSession(getActivity(), "91707", this);
                    etizationManager.setRewardListener(getActivity());
                 break;
            }
        }
    });


A: Try this
1 First Way
m_OfferList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
            switch (position){
                case 1:
                  // 2nd item Clicked
                    MonetizationManager.createSession(getActivity(), "91707", this);
                    etizationManager.setRewardListener(getActivity());
                 break;
            }
        }
    });

2 Second Way
if(position==1)
{
m_OfferList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {

                  // 2nd item Clicked
                    MonetizationManager.createSession(getActivity(), "91707", this);
                    etizationManager.setRewardListener(getActivity());

        }
    });

}


A: If you want to add listener to the view which is in the position 1, then you may use
m_OfferList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
            switch (position){
                case 1:
                    MonetizationManager.createSession(getActivity(), "91707", this);
                    MonetizationManager.setRewardListener(getActivity());
                    (here_put_your_view_type)view).setYourListner();
            }
        }
    });


A: Please use this example i have perfect works
 //first declare interface in adapter class on

        customButtonListener customListner;

        public interface customButtonListener {
            public void onButtonClick(String song_id);
        }

        public void setCustomButtonListner(customButtonListener listener) {
            this.customListner = listener;
        }

    //and use any view or button click

    button.customListner.onButtonClick(int position)

    //Adapter where use 

    adapter.setCustomButtonListner(this);


//Implement this method in activity

    @Override
    public void onButtonClick(int position)
    {

    }

i hope help this
