1

I have an unwanted problem by default in spinner view.

On Android 2.2 when I double click any spinner it opens twice, Upon pressing the back button the 2nd spinner closes but 1st one remains open.

I need a fix for this issue.

I only want the spinner to show once regardless of how many times the user clicks it.

This problem doesn't exist in Android 4.0+.

Is there a way to fix this bug?

Varun Vishnoi
  • 328
  • 6
  • 23

2 Answers2

1

You can use setEnabled(false) when user click on item first time to prevent further interaction, and make setEnabled(true) when you need.

Dmytro Danylyk
  • 19,684
  • 11
  • 62
  • 68
1

You can use something like this,

Possibly in your onClick();

view.setEnabled(false);

new Handler().postDelayed(new Runnable() {
@Override
public void run() {
view.setEnabled(true);
}
}, TIME_IN_MS);
Kartihkraj Duraisamy
  • 3,171
  • 2
  • 25
  • 36