I tried to create a Notification with this Code:
private void setNotificationAlarm(Context context)
{
Intent intent = new Intent(getApplicationContext()
you can use
Intent switchIntent = new Intent(BROADCAST_ACTION);
instead of using
Intent intent = new Intent(getApplicationContext() , MyNotification.class);
in here BROADCAST_ACTION is action that you are defining in manifest
you can catch it by using that action name
public class MyNotification extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String act = "your package.ANY_NAME";
if(intent.getAction().equals(act)){
//your code here
}
}}