2
votes

My collegue and I are programming a xamarin.forms app. In our app there is a timepicker. The value of that time is stored in sqlite database and loaded when the page is loaded. The time is stored in utc time and displayed in local time. Is there a possibility to react on timezone changes without closing and reopen the app.

For example: I am in Austria and set the time to 9:00. When I am travelling to London 8:00 should be displayed without closing and reopening the app.

Is there something like a timezone changed event in xamarin?

1

1 Answers

4
votes

I don´t think so.

You will have to create different implementations for each plataform.

You can listen to time changes event in android using the actions Intent.ACTION_TIMEZONE_CHANGED, and Intent.ACTION_TIME_CHANGED.

And on iOS you can listen to the applicationSignificantTimeChange method in your AppDelegate.

The docs also say that if the time change happens when your app is in the background you will get it when you go to the foreground

If your application is currently suspended, this message is queued until your application returns to the foreground, at which point it is delivered.

I don´t know any method to listen to time changes on Windows Phone.