Skip to content

Conversation

@muryno
Copy link
Contributor

@muryno muryno commented Feb 4, 2024

Fixes #415

Refactor: Use BroadcastReceiver for TileService activity launch

Switched to BroadcastReceiver approach for starting an activity from a TileService due to its compatibility with Android's security guidelines, ensuring a smooth and non-intrusive user experience. An alternative could be using notifications, but they may not prompt immediate action as effectively.

The notification approach, while less intrusive, may not be ideal for all scenarios, especially if immediate action or interaction is required from the user. Notifications can be easily missed or ignored, leading to a less responsive or immediate user experience.
More guide on this Android developer guide

Muraino Yakubu added 2 commits February 3, 2024 10:31
To resolve the UnsupportedOperationException when starting an activity directly from TileService, this commit introduces a BroadcastReceiver as an intermediary. This approach aligns with Android's best practices for inter-component communication and ensures a smoother user experience by avoiding unexpected interruptions from Quick Settings tiles.
@muryno
Copy link
Contributor Author

muryno commented Feb 4, 2024

Fixes: #415

@inson1
Copy link
Contributor

inson1 commented Feb 5, 2024

@muryno btw you need to add it to the op post, so the issue linked to the PR :)

@muryno
Copy link
Contributor Author

muryno commented Feb 5, 2024

@muryno btw you need to add it to the op post, so the issue linked to the PR :)

what is OP @inson1 😊

@inson1
Copy link
Contributor

inson1 commented Feb 6, 2024

@muryno original post - I meant that it should be in first post, writting it in comment doesnt link the issue and the pr together

@muryno
Copy link
Contributor Author

muryno commented Feb 7, 2024

@muryno original post - I meant that it should be in first post, writting it in comment doesnt link the issue and the pr together

Thank you @inson1 I already did that, was posted in both 😊

@inson1
Copy link
Contributor

inson1 commented Feb 10, 2024

@muryno but its still not linked - I meant in first post in this PR, sorry for being clear :)
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
your
chrome_lTQE0JQ03w
how it should look like (but it should be linked only with one)
chrome_tS8c3Gyyf5

@muryno muryno changed the title Implement BroadcastReceiver to start activity from TileService fix: Implement BroadcastReceiver to start activity from TileService Feb 26, 2024
@clementwzk
Copy link
Owner

There is a conflict @muryno

@muryno
Copy link
Contributor Author

muryno commented Mar 11, 2024

There is a conflict @muryno

now resolved

@clementwzk
Copy link
Owner

I'm not able to launch OpenCalc from Tiles 🤔

@muryno
Copy link
Contributor Author

muryno commented Mar 11, 2024

Tiles
will check this

@muryno
Copy link
Contributor Author

muryno commented Mar 17, 2024

@Darkempire78 now updated from using broadcast receiver and sticking with google documentation TileService

@clementwzk
Copy link
Owner

Thank you! 🤩

@clementwzk clementwzk merged commit 2e0ba59 into clementwzk:main May 23, 2024
@clementwzk
Copy link
Owner

clementwzk commented May 23, 2024

Sorry for the waiting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Starting activity from TileService using an Intent is not allowed.

3 participants