tags:

views:

35

answers:

1

package com.broadcastreceiver;

import java.util.ArrayList; import android.appwidget.AppWidgetManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log;

public class ExampleBroadCastReceiver extends BroadcastReceiver {

@Override
public void onReceive(final Context context, final Intent intent) {
    // TODO Auto-generated method stub

     Log.d("ExmampleBroadcastReceiver", "intent=" + intent); 
     Intent intent1 = new Intent(context,Login.class); 
        context.startActivity(intent1); 

} 

}

I run this above code change the time zone in settings not calling other activity can anybody tell what is problem

A: 

I guess you didn't include the following lines in your AndroidManifext.xml, did you?

 <receiver android:name=".ExampleBroadcastReceiver" android:enabled="false">
     <intent-filter>
         <action android:name="android.intent.ACTION_TIMEZONE_CHANGED" />
         <action android:name="android.intent.ACTION_TIME" />
     </intent-filter>
 </receiver>
Martin
Yes i written this code