I'm having problems in an android app, when trying to send a notification everything happens 100% until I get to open the notification activity.
This calling activity needs a "store" parameter and I'm not able to send it via notification.
See the sources below:
private void Notify(String notificationTitle, String notificationMessage){
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
@SuppressWarnings("deprecation")
Notification notification = new Notification(R.drawable.header_logo,"New Message", System.currentTimeMillis());
Intent notificationIntent = new Intent(NewReviewActivity.this,ReviewActivity.class);
notificationIntent.putExtra("store",String.valueOf(store.getStore_id()));
PendingIntent pendingIntent = PendingIntent.getActivity(NewReviewActivity.this, 0, notificationIntent, 0);
notification.vibrate = new long[]{150, 300, 150, 600};
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.setLatestEventInfo(NewReviewActivity.this, notificationTitle, notificationMessage, pendingIntent);
notificationManager.notify(9999, notification);
}
And my logcat:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.projects.storefinder/com.projects.activities.ReviewActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to com.models.Store
It is clear that the problem is that the parameter is not being properly passed.
Could you help me?