Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set single notification for multiple alarm manager at same time
    primarykey
    data
    text
    <p>My application requirement is User can set multiple type reminder for same time, so at that time notification is pop up along with it's sound</p> <p>My code is:</p> <pre><code>public class ReminderService extends Service { int id; @Override public IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null; } @Override public void onStart(final Intent intent, int startId) { // TODO Auto-generated method stub super.onStart(intent, startId); if (intent != null) { new Thread() { public void run() { id = intent.getIntExtra("ID"); showNotification(id); } }.start(); } } Handler mHandler = new Handler(); public void showNotification(final int id) { mHandler.post(new Runnable() { @Override public void run() { // TODO Auto-generated method stub try { Notification notification = new Notification( R.drawable.icon, getString(R.string.app_name), System.currentTimeMillis()); notification.sound = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.pluck_b); Intent i = new Intent(); i.setClass(ReminderService.this, MyClass.class); i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); notification.setLatestEventInfo(ReminderService.this, getString(R.string.app_name), message, PendingIntent.getActivity(ReminderService.this, 0, i, 0)); NotificationManager nm = (NotificationManager) ReminderService.this .getSystemService(Context.NOTIFICATION_SERVICE); notification.flags |= Notification.FLAG_AUTO_CANCEL; nm.notify((int) id, notification); } catch (Exception e) { } } }); } } </code></pre> <p>Suppose user set 3 reminder for 10:30, so it will call 3 times this service, and 3 time different notification will call, so notification sound is also not proper as it create 3 different notification.</p> <p>So now what have to do, I want to call single notification for these 3 different reminder using remote view, so sound will single.</p> <p>But to create remote view how can I identify number of alarm at same time.</p> <p>Please any one help me to identify best approaches, what I have to do in this case so notification sound would be single for different notification.</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.
    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