So I changed my code to call a broadcast receiver instead of calling the main activity
Intent notificationIntent = new Intent(context, com.plugin.statusNotificationForGCM.statusNotificationForGCMReceiver.class);
notificationIntent.putExtra(NOTIF_RESPOND, runThis);
notificationIntent.setAction(Intent.ACTION_VIEW);
notificationIntent = notificationIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
//contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
contentIntent = PendingIntent.getBroadcast(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
The problem is I added this in my receiver, but don’t think its running. Don’t see the tag and Log in the console when I click the notification
public class statusNotificationForGCMReceiver extends BroadcastReceiver {
private static final String TAG = "statusNOTIFICATIONReceiver";
@Override
public final void onReceive(Context context, Intent intent) {
Log.v(TAG,"ASDFSJD FASDF ASDPFJA SDFPAUS DFPAS DFASDF");
}
}
Is there something I am missing? Do I have to add something to the manifest file?
Thanks
You may need to have this in manifest :
Suitable intents are defined in its
<intent-filter>Addenda:
an intent filter lets you tell an activity what it can/cannot respond to (when called by intent).
You can call it in an Activity for instance for a button clicked like this: