calling background service from BroadcastReceiver....
- by Shalini Singh
Hi , i am trying to call a push notification background from BroadcastReceiver class.but my application is going to crash the code is given bellow
public class AlarmReceiver extends BroadcastReceiver {
Context ctx;
static int count=1;
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
//Toast.makeText(context, "working"+count, Toast.LENGTH_LONG).show();
count++;
Log.e("broadcast***","receiver");
Intent myIntent=new Intent(context,NotifyService.class);
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myIntent);
}
} * manifest entry:-
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
Error:
05-24 15:17:00.042: ERROR/AndroidRuntime(424): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.alarm/com.android.alarm.NotifyService}; have you declared this activity in your AndroidManifest.xml?
Please help me....