I am using following code in service to open the main/launcher Activity , the code worked fine until I declared this project as library and created two other projects which use this library.
So in the onStartCommand of service this code is written.
final Notification notification = new Notification(R.drawable.ic_launcher, null, 0);
String notifTitle = "Service";
String notifMessage = "Running";
final Intent notificationIntent = new Intent(this, MainActivity.class);
notificationIntent.putExtra("extra", "value");
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
notificationIntent.setAction("android.intent.action.MAIN");
notificationIntent.addCategory("android.intent.category.LAUNCHER");
final PendingIntent contentIntent = PendingIntent
.getActivity(this, 0, notificationIntent,0);
notification.setLatestEventInfo(this, notifTitle, notifMessage, contentIntent);
startForeground(17, notification);
MainActivity.class is part of library, two projects which use this library have their main Activities MainActivityA , MainActivityB which extend MainActivity of library.
Now the problem is when I click notification of service, MainActivityA or MainActivityB should be launched but right now nothing happens, but previously it worked when library was a project itself
Any ideas would be appreaciated alot ,
Thank you,