JUMP TO SOLUTION Solved

Original topic:

Galaxy watch 4 bringing application back to foreground (programmatically)

(Topic created: 09-20-2021 04:32 AM)
1498 Views
userZQCXRiJzCk
Constellation
Options
Galaxy Watch

Hi,
After porting Android application that previously ran on Wear OS to Galaxy watch 4 I came upon unexpected issue with bringing the application back to foreground after it was sent to background by pressing on the Home button.
In Wear OS it was a simple matter of starting an empty activity while in background what returned the application back to the fore.
In Galaxy watch 4 it doesn't work (probably due to new Google restrictions concerning opening activities while in background: https://developer.android.com/guide/components/activities/background-starts).

I was trying to resolve this issue by ambient mode but without success.
So I would really appreciate your kind assistance in solving this:
How can I bring application back to foreground programmatically in Galaxy watch 4. 
Thanks in advance

0 Likes
Reply

1 Solution


Accepted Solutions
Solution
userZQCXRiJzCk
Constellation
Options
Galaxy Watch

the solution is requesting the following permission:
android.permission.SYSTEM_ALERT_WINDOW

This allows app overlay that in turn allows starting activities while app in BG

View solution in context

2 Replies
LongHiker
Galactic Samsung Care Ambassador
Options
Galaxy Watch

@userZQCXRiJzCk I think that you would have much better luck posting this question in a Wear OS developers forum. 

Solution
userZQCXRiJzCk
Constellation
Options
Galaxy Watch

the solution is requesting the following permission:
android.permission.SYSTEM_ALERT_WINDOW

This allows app overlay that in turn allows starting activities while app in BG