-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shortcut not loading correct view after closing app using home button #1472
Comments
This is what I see when I perform the same steps on my Pixel 4 XL https://photos.app.goo.gl/yecZMhPPYAStLTGP6 Do you see the same issue with actionable notifications? Have you tried a debug build that has a clean app state to see if its just bad data that needs to be cleaned up? |
So after further tests, this is only happening if I have exited the HA app using the back button before using the first shortcut. If I use the Home button to exit the app the shortcuts take me to the right place. The same think is happening with clickAction in notifications, but again only if the app was closed using the back button before receiving the notification. |
hmm can you update the video with that finding so I can see if I can reproduce it here? I just tried to exit the app using back button and then launch shortcuts but they still work as expected lol. Also lets look at the raw logs to see what is happening here we should see something I think. I would also still check the debug build too to ensure its not data related. |
I've updated the video sowing the closing of the HA app first, and also using the debug build to eliminate data issues. |
Tahnks for the video I was able to reproduce it. This is what I see in the logs when the same window is reused
I think the issue here is that we are using the following flag in all instances of starting a new activity here: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK Might need to look into the other flags to see which we should use possibly need to add: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK |
It appears I was correct in my assumption, will continue testing as I wrap up another enhancement to shortcuts. Thank you for reporting and updating the videos it was very helpful :) |
Thanks, I've also noticed that an entity shortcut will open the app showing the more info panel for that entity but this then disappears after around 1 second and shows the default view in the app instead. Would this also be down to using FLAG_ACTIVITY_NEW_TASK or is that a separate issue? |
I have not noticed this behavior. |
Looks like that other issue (with the entity shortcuts) may actually be caused by card-mod as, when I remove that from my Lovelace resources, the shortcut works without the default view being displayed after a second, so I'll raise an issue over there. |
ah thanks for checking that :) in case they ask this is how we are calling the pop-up, a lil bit of JS |
Home Assistant Android version: beta-644-6e9ac72-full
Android version: 10 (EMUI 11.0.0)
Phone model: Huawei Mate 20 Pro
Home Assistant version: 2021.4.0b0
Last working Home Assistant release (if known):
Description of problem:
When opening a pinned or dynamic shortcut and then backing out of the app using the home button, opening a second shortcut will sometimes just open the app showing the last open view.
Have been able to reliably reproduce this by:
If the app is closed using the back button, the shortcuts work as expected.
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
Screenshot of problem:
Screen recording of a minimal reproduction using two test shortcuts and views:
SVID_20210401_215031_1.mp4
(Updated screen recording using debug build of app and showing the closing of the HA app)
Additional information:
Using Nova Launcher, but also been able to reproduce using Huawei Home launcher.
The text was updated successfully, but these errors were encountered: