5

I've implemented a push notification with a pending intent so when the user clicks the notifications it opens a screen with details.

It's working fine on all devices HTC .. Samsung S2, S3, ACE and ACE+

But for some reason it's not working S4 or S5 .. anybody had this problem ?

I'm using the NotificationCompact class

elmorabea
  • 3,243
  • 1
  • 14
  • 20
  • What is your error. I use the NotificationnCompat class - it works fine on Samsung devices. Please put your logcat here. – Booger May 07 '14 at 12:50
  • Not error, when you click on it nothing happens, the notification bar is collapsed up and instead of opening my activity, nothing happens – elmorabea May 07 '14 at 12:51
  • I am confident there is an error, double check your logcat. I will reiterate that this is likely NOT a device compatibility issue, but something wrong with YOUR code. – Booger May 07 '14 at 12:55
  • There is no log when i click on the notification .. – elmorabea May 07 '14 at 12:57
  • 2
    Found the answer thanks to that [Here][1] [1]: http://stackoverflow.com/questions/19031861/pendingintent-not-opening-activity-in-android-4-3 – elmorabea May 07 '14 at 13:07
  • Changing the requestCode in the pendingIntent has helped me. Got this help from the answer of this question: http://stackoverflow.com/a/19166954/1637525 – Marka A Sep 23 '14 at 11:45
  • @MarkaA, see my above comment :), but thanks for your comment – elmorabea Sep 23 '14 at 22:38

1 Answers1

4

Set requestCode on PendingIntent to non-zero value.

PendingIntent.getActivity(this, 42, intent, PendingIntent.FLAG_UPDATE_CURRENT);
//                              ^^ THIS
Pitel
  • 5,334
  • 7
  • 45
  • 72