Program to get Timezone Change Event in Android Phone
This Program is to implement time zone change event in broadcast receivers By normal We have to restart some threads or process or reset timers to reflect with new timezone. An alternative option is to receive the Timezone change in android
Add the values (register) in manifest file as shown below
<receiver android:name="Boottzchangereciver" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
Source code to Get Timezone Change
public class Boottzchangereciver extends BroadcastReceiver {
@Override
public void onReceive(Context c, Intent i) {
// TODO Auto-generated method stub
try{
if (Intent.ACTION_TIMEZONE_CHANGED.equals(i.getAction())) {
Intent intent = new Intent();
c.startService(intent);
}}}
