Among the menu in ListView,

Asked 2 years ago, Updated 2 years ago, 88 views

ListView menu

"A", "B", "C", and "D" I'd like to put a limit on touch events for "D" aside from the rest

For example,

To limit the menu activation by pressing the Menu key 5 times while pressing the Menu key 5 times, How should I walk?

listview clickevent

2022-09-21 14:34

1 Answers

Assuming that you are saving boolean for the conditions you mentioned,

boolean isActivation;

view.setOnClickListener(new View.OnClickListener{
    @Override
     public void onClick(View v){
         if(!isActiovation) return;
        //do something
    }
});

It can be implemented as above. You can also think of ways to not install ClickListener or prevent touchEvent itself.


2022-09-21 14:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.