I am using the google mobile backend starter https://cloud.google.com/cloud/samples/mbs/ and everything works until I want to try and send notifications from GCMintentService.java. If I call
Intent resultIntent = new Intent(this, MyActivity.class);
I get an error that MyActivity in the App module does not exist. As explained here error: package does not exist android google mobile backend starter this is because I cannot depend on a application module from a library module.
So my question is, if I want to use an intent in a library module to call an activity in an application module how do I do this? I have included some code would in case it helps for this specific example:
public void generateNotification(){
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("My notification")
.setContentText("Hello World!");
// The line below is the one causing the problem with RideListActivity which is in the application module
Intent resultIntent = new Intent(this, RideListActivity.class);
PendingIntent resultPendingIntent =
PendingIntent.getActivity(
this,
0,
resultIntent,
PendingIntent.FLAG_UPDATE_CURRENT
);
mBuilder.setContentIntent(resultPendingIntent);
int mNotificationId = 001;
NotificationManager mNotifyMgr =
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
mNotifyMgr.notify(mNotificationId, mBuilder.build());
};