0

I have used a spinner on a custom alert box. Once the alert pops up there is a spinner attached to it. And after the user clicks on the spinner it gives you a list of countries. And i am searching a way to remove/hide/dismiss that country list (Only the spinner list) programmatically. How to accomplish this?

My goal is to remove that country list which generated from the spinner, once the onPause of the activity invoked.

Cœur
  • 37,241
  • 25
  • 195
  • 267
nala4ever
  • 757
  • 2
  • 8
  • 18

3 Answers3

1

You may hide the spinner by setting its visibility GONE or by making setEnabled(false). But, that doesnt solve your problem i guess. You may have to override onResume() and onPause() methods for that.

Seshu Vinay
  • 13,560
  • 9
  • 60
  • 109
0

Thank you guys. Dismissing the drop down list is not possible it seems. Tried several ways like dispatching beck key events, calling onbackpressed etc... Finally I removed the pop up dialog box (custom dialog) itself when the app goes to the background. Thank you so much for the help :)

nala4ever
  • 757
  • 2
  • 8
  • 18
0

If you want to disable your spinner then it may helpful for you.
Spinner.setEnabled(False);

Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160