I need to open app in current state, without any new instance of my main Acitivity
Here is my code
Intent intent = new Intent(baseActivity, MainActivity.class);
intent.putExtra("FROM_NOTIFICATION", true);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK);
PendingIntent pendingIntent = PendingIntent.getActivity(baseActivity, 0 /* Request code */, intent,
PendingIntent.FLAG_ONE_SHOT);
and
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(baseActivity)
.setSmallIcon(getNotificationIcon()).setLargeIcon(BitmapFactory.decodeResource(baseActivity.getResources(), R.drawable.ic_launcher))
.setContentTitle(baseActivity.getResources().getString(R.string.app_name))
.setContentText(message)
.setOngoing(true)
.setContentIntent(pendingIntent);
notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
How can I do this? Or is there another way?