Note that there are some explanatory texts on larger screens.

plurals
  1. POShow single screen with different data for notification
    primarykey
    data
    text
    <p>From web service I have received list of data.I have to show the list of notification for the received data.To show notification I have used following code.But when I clicked the notification item I can able to view the last data from the List. How to solve this.</p> <p>For example if list item 1 has the name = "name1" and list item 10 has the name="name 10". when I clicked the notification 1. It show's the details about the list item 10</p> <pre><code> ArrayList&lt;MYObject&gt; list= &lt;List of data from webservice&gt; .... for(int i=1;i&lt;list.size();i++){ createNotification(list.get(i),i); } ..... ........ public void createNotification(MYObject obj, int notificationId) { NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); Notification myNotification = new Notification( R.drawable.notification_icon, "Title!", System.currentTimeMillis()); String notificationTitle = "My Title"; String notificationText = "My Notification text"; Intent myIntent = new Intent(context.getApplicationContext(), DetailView.class); myIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); myIntent.putExtra("detail", obj); PendingIntent pendingIntent = PendingIntent.getActivity( context.getApplicationContext(), 0, myIntent, 0); myNotification.defaults |= Notification.DEFAULT_SOUND; myNotification.flags |= Notification.FLAG_NO_CLEAR; myNotification.setLatestEventInfo(context, notificationTitle, notificationText, pendingIntent); notificationManager.notify(notificationId, myNotification); } </code></pre>
    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.
    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