The default time zone will be automatically detected by the system, so you do not need to explicitly specify TimeZone.setDefault ().
Automatic time zone detection does not work on the emulator, but you can use the "timezone" start flag to set it.
In addition, the recommended way to change the time zone is the settings application, which is not included in the current sdk .. At the moment, you can use the following:
AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE); alarm.setTimeZone(timezone);
He works with
<uses-permission android:name="android.permission.SET_TIME_ZONE"/>
source share