How to block an item from a listview?

2

I have a TextView list in a ListView , and when I click on one of the TextView I have access to a Fragment in>. How do I, when in a Fragment , the TextView responsible for opening it is blocked? Therefore, the application will not be forced to open the same Fragment repeatedly!

    
asked by anonymous 06.06.2015 / 04:52

1 answer

1

Use java view.setClickable(Boolean.FALSE); within the onClick method of your listView:

    listView.setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> arg0, View rootView, int pos, long id) {
        // hard processing
        ...
        rootView.setClickable(Boolean.FALSE);
        ...
       // More hard processing
    }
    
09.06.2015 / 01:28