extras de intenção são duplicados ao usar FLAG_UPDATE_CURRENT em PendingIntent ao criar notificações do Android
Quero criar várias notificações que iniciem uma atividade (ou atualizem-na) para exibir uma descrição do produto.
<code>Notification notification = new Notification(R.drawable.applicationicon, Resources.getString("NewSaleNotification", context), System.currentTimeMillis()); // Hide the notification after its selected notification.flags |= Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(context, MainApplication.class); intent.putExtra("saleid", saleid); // to be sure the activity won't be restarted intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); notification.setLatestEventInfo(context, SaleTitle, SaleMessage, pendingIntent); notificationManager.notify(saleid, notification); </code>
Quando eu crio o PendingIntent, eu tenho 4 opções: FLAG_CANCEL_CURRENT, FLAG_NO_CREATE, FLAG_ONE_SHOT e FLAG_UPDATE_CURRENT.
A definição do último (http://developer.android.com/reference/android/app/PendingIntent.html#FLAG_UPDATE_CURRENT) é o que eu quero fazer, mas não funciona como deveria. Se eu criar 2 notificações, ambas terão o mesmo 'saleid' extra que é o mais recente. Como posso fazer mais de uma notificação com um extra 'saleid' diferente?