How to notice changes in time zones in Android?

You can listen to all configuration changes by setting android:configChanges in AndroidManifest.xml and acting accordingly in the onConfigrationChanged method ( Android docs ).

What I have not yet found is a handler that acts on changes in time zones. This can happen, for example, if a user often crosses time zones after a trip and wants to see his application contents in the local time of the country in which he is located.

Is the only opportunity I have here to really check TimeZone.getDefault() to adapt my time accordingly and myself?

+4
source share
1 answer

Listen to broadcast intent: android.intent.action.TIMEZONE_CHANGED

+11
source

Source: https://habr.com/ru/post/1445724/


All Articles