Get Android Timezone Change Event

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);
}}}


Related Topic Unique Features of Android Development Platform
How to Create a New Project with Native Android View Controls
How to Modifying Existing View Components in Android
Android: Java Class for Patch Files Sending and Receiving
Android's Bluetooth Inbound and Outbound Transfer

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback