I have a service with a foreground notification. How can launch an activity when user tap on the foreground Notification?
I have tried with:
// CREATE NOTIFICATION FOREGROUND
Intent notificationIntent = new Intent(getApplicationContext(), HomeActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, notificationIntent, 0);
Notification notification = new NotificationCompat.Builder(getApplicationContext())
.setContentTitle("Title")
.setTicker("Test service")
.setContentIntent(contentIntent)
.setContentText("text...").build();
startForeground(1, notification);
//======================================================================================
i need to start HomeActivity when user tap foreground notification.