I receive a notification in MainActivity. When I click on it, it should open the dialog fragment. Currently I am doing this -
String textNotificationMessage = textMessageReceivedEvent.getMessage();
Intent notificationIntent = new Intent(MainActivity.this, MessagingDialogFragment.class);
notificationIntent.putExtra("NotificationMessage",textNotificationMessage);
MessagingDialogFragment messagingDialogFragment = (MessagingDialogFragment) MessagingDialogFragment.instantiate(MainActivity.this, MessagingDialogFragment.class.getName());
messagingDialogFragment.show(getSupportFragmentManager(),MessagingDialogFragment.class.getName());
PendingIntent pi = PendingIntent.getActivity(MainActivity.this, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);
Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
What this does is, whenever I have a notifictaion, it opens the DialogFragment
automatically without a click. But I need it to open after a click. How do I achieve this?