CopyPastor

Detecting plagiarism made easy.

Score: 0.7738448513467366; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-07-06
by ORBIT

Original Post

Original - Posted on 2017-06-28
by Ramachandran A



            
Present in both answers; Present only in the new answer; Present only in the old answer;

See below code. Opening Activity.
NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(icon, message, when); Intent notificationIntent = new Intent(context, HomeActivity.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0); notification.setLatestEventInfo(context, title, message, intent); notification.flags |= Notification.FLAG_AUTO_CANCEL; notificationManager.notify(0, notification);
See below code. I am using that and it is opening my HomeActivity.
NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(icon, message, when); //change HomeActivity.class which activity you want to open after clicking notification Intent notificationIntent = new Intent(context, HomeActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, title, message, intent); notification.flags |= Notification.FLAG_AUTO_CANCEL; notificationManager.notify(0, notification); change HomeActivity.class which activity you want to open after clicking notification.. hope it will work...

        
Present in both answers; Present only in the new answer; Present only in the old answer;