Among the menu in ListView,

Asked 1 years ago, Updated 1 years ago, 75 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.