Note that there are some explanatory texts on larger screens.

plurals
  1. PONotification activity called by AlarmManager NOT to pop up when app is closed
    primarykey
    data
    text
    <p>For a custom reminder app, I'm using <code>AlarmManager</code> and <code>PendingIntent</code> to set a specific time for my <code>Notification</code> to pop up. </p> <p>I have my <code>NotificationManager</code> in <code>ReceiverActivity</code> </p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_alarm_receiver); String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); Context context = getApplicationContext(); CharSequence ticker = "You have notification"; CharSequence contentTitle = "My Reminder"; CharSequence contentText = "Reminder Content"; Notification notification = new Notification(R.drawable.notif_icon, ticker, System.currentTimeMillis()); Intent notificationIntent = new Intent(this, AlarmReceiverActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); final int HELLO_ID = 1; mNotificationManager.notify(HELLO_ID, notification); } </code></pre> <p>The ReceiverActivity pops up at the specified time plus the notification in the notification bar (upper left) and all is well. But its not so user friendly, I want only the notification to appear in the notification bar without any activities popping up when app is closed (where in realistic situations, is probably closed at the time your reminder is due)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload