all be healthy
The problem is this: at the entrance there is a certain list of objects that is formed in the service. When receiving this list, it is necessary to make notifications one for each position (from the same service).
I create notifications, I throw intents there, but when I click on an intent, the necessary activation opens and takes some kind of heresy from this intent.
Where am I wrong?
private void sendNotificationEarchNewItems(List<Map<String, Object>> newIrems) { final List<Map<String, Object>> locList = newIrems; final Handler uiHandler = new Handler(Looper.getMainLooper()); uiHandler.post(new Runnable() { @Override public void run() { for (Map map : locList) { final Context context = getApplicationContext(); final String idd = map.get("_id").toString(); final int NOTIF_ID = Integer.parseInt(idd.substring(0, 6)); final NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Intent intent = new Intent(getApplicationContext(), ItemActivity.class); intent.putExtra("_id", idd); PendingIntent pIntent = PendingIntent.getActivity(thisContext, 0, intent, 0); final Notification notification = new NotificationCompat.Builder(context) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(map.get("title").toString()) .setContentIntent(pIntent) .build(); notificationManager.notify(NOTIF_ID, notification); final RemoteViews contentView = notification.contentView; final int iconId = android.R.id.icon; Picasso.with(getApplicationContext()).load(map.get("mainImage").toString()).into(contentView, iconId, NOTIF_ID, notification); } } }); }