I have resolved the error by AlarmManager alarms = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
but now at the time of execution getting exception--- 08-26 16:29:52.850: ERROR/AndroidRuntime(382): Uncaught handler: thread main exiting due to uncaught exception 08-26 16:29:53.030: ERROR/AndroidRuntime(382): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.test/ com.example.test.TestBroadcastActivity}: java.lang.ClassCastException: com.example.test.TestBroadcastActivity 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2417) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2512) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.os.Handler.dispatchMessage(Handler.java:99) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.os.Looper.loop(Looper.java:123) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.app.ActivityThread.main(ActivityThread.java:4363) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at java.lang.reflect.Method.invokeNative(Native Method) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at java.lang.reflect.Method.invoke(Method.java:521) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at dalvik.system.NativeStart.main(Native Method) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): Caused by: java.lang.ClassCastException: com.example.test.TestBroadcastActivity 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2409) 08-26 16:29:53.030: ERROR/AndroidRuntime(382): ... 11 more 08-26 16:29:53.250: INFO/Process(66): Sending signal. PID: 382 SIG: 3 08-26 16:29:53.250: INFO/dalvikvm(382): threadid=7: reacting to signal 3 08-26 16:29:53.250: ERROR/dalvikvm(382): Unable to open stack trace file '/data/anr/traces.txt': Permission denied what is the exact way to schedule an activity in android? please help -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en