Closed burhanloey closed 5 years ago
Correction: The listener is not a message queue, it's just that the listener will only run after onCreate() is done.
Found a neat trick by using TouchListener: https://stackoverflow.com/a/28466880/3987167
Fixed by e3d5e4bc39068e8fa318d29bc6b356b4851f202c
It technically does, but it gets reset back by state spinner.
During onCreate(), when state spinner calls setSelection(), it executes the listener as well, resetting the district spinner to first item. The problem gets worse because the listener execution is highly likely a message queue, meaning there is no way to execute it in order.
One solution, albeit a dirty hack, is to just use postDelayed().