Reputation: 327
I have map and some views on it. I would like to make some views disapearing when there is no user interaction (no touch, no click on map) and when interaction is detected then I would like to show a view, like with default zoomControls on android google map. How could I do it ? Anybody can help I would be thankful?
Upvotes: 0
Views: 668
Reputation: 2784
Don’t use TimerTask. That runs a separate thread, but in Android you are only allowed to make UI calls from the UI (main) thread.
Instead, in your Activity, create yourself a Handler. You can then use its postAtTime or postDelayed methods to queue runnables that will run at (approximately) the specified time on the UI thread. These runnables are free to make UI calls.
Upvotes: 3