question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tapping on notification shows a blank screen

See original GitHub issue

Describe the bug

Whenever you tap on a notification for a message, it takes you to a blank screen.

To Reproduce

Steps to reproduce the behavior:

  1. Send a message to yourself from another account.
  2. Tap on the notification.

Screen recording

https://user-images.githubusercontent.com/45288858/116685535-212fbb00-a9d0-11eb-8ac8-c20c41e0e599.mp4

Expected behavior

My expected behavior is that it goes to the respective chat when clicked on the notification.

Smartphone (please complete the following information):

  • Device: Samsung M31
  • OS: Android 11

Additional context

  • App version and store: 1.1.6 - F-Droid
  • Homeserver: matrix.org

Self investigation

I tried replicating this bug on Emulators with Android 11,8,7 but they seem to work perfectly fine. Searching for the same problem on https://matrix.to/#/#element-android:matrix.org and others also seem to have this problem.

I looked at the code and the following line seems to be the reason behind the blank screen.

https://github.com/vector-im/element-android/blob/38e83e1f3569ce5667ce782b1c4e2bf9b48474f8/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailActivity.kt#L86

Upon debugging it is evident that getParcelable on the following line returns null.

https://github.com/vector-im/element-android/blob/38e83e1f3569ce5667ce782b1c4e2bf9b48474f8/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailActivity.kt#L84

Finding where the intent for the notification is created, I stumbled upon this comment

https://github.com/vector-im/element-android/blob/38e83e1f3569ce5667ce782b1c4e2bf9b48474f8/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt#L691

This might be what is causing the bug. The pending intent doesn’t seem to have any extra args. But the intent is created with the roomId as it’s data just in case.

https://github.com/vector-im/element-android/blob/38e83e1f3569ce5667ce782b1c4e2bf9b48474f8/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt#L692

So to have a temporary fix, I changed the getParcelable line as follows:

intent?.extras?.getParcelable(EXTRA_ROOM_DETAIL_ARGS) ?: intent?.dataString?.split("?")?.let { RoomDetailArgs(roomId = it[1]) }

Getting the roomId from the Intent’s data fixed it temporarily. But I will await for a better solution to this bug from the element android team.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tlpbucommented, Jul 25, 2021

Same issue with notification: Device: Samsung Galaxy S20 OS: Android 11

Additional context App version and store: 1.1.14 Homeserver: selfhosted private

1reaction
peterx1024commented, Apr 30, 2021

Same issue with notification: Device: Samsung M11 OS: Android 10

Additional context App version and store: 1.1.6 - F-Droid Homeserver: matrix.org

Read more comments on GitHub >

github_iconTop Results From Across the Web

When i touch the notification shows only white blank screen ...
Press your device's power button. When the animation starts, press and hold your device's volume down button. Keep holding it until the ...
Read more >
Blank/White screen whenever a message is received ... - GitHub
Whenever I receive a new message, I get a notification (as usual); when I tap on that notification in the bar to bring...
Read more >
Tapping on notification from lockscreen causes black screen ...
Sometimes when i tap on a notification from telegram on the lock screen it brings me to a black screen, showing nothing.
Read more >
Flutter FCM push notification show the blank screen when ...
So it got null exception, results in blank screen. I got same issue and found this as main cause. I used try and...
Read more >
How to fix display not waking up with incoming calls issue
Step 1: Go to App Info of the Phone Dialer app and tap on Notifications. ; Step 2: Tap on the 'Incoming Calls'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found