Razeeman / Android-SimpleTimeTracker

Simple app that tracks time.
GNU General Public License v3.0
641 stars 80 forks source link

[Bug] `No Activity found to handle Intent` when trying to use time tracking automation #68

Closed thehale closed 1 year ago

thehale commented 1 year ago

I'm trying to use the new time tracking automation features (see #11) via the application MacroDroid so that I can use MacroDroid's WearOS companion app to trigger time changes from a smartwatch (compare #60).

However, I can't seem to figure out the settings required to send off a functional Intent from MacroDroid. Copying the values exactly from the in-app description still gives me a No Activity found to handle Intent error message.

Here's my configuration in MacroDroid (part of the text fields are cut off, I promise they exactly match): scrcpy_g9zrbB3Sow

Here's the error message I get when triggering the MacroDroid configuration: scrcpy_yiKRbwQVdw

A second free task automation app called Shortcut Maker also had the same issue. Here's that configuration: scrcpy_SqMhNZ2RzE

And the corresponding error message for Shortcut Maker: scrcpy_AEzrNnRClL

Shortcut Maker does have a feature where it lists all the activities/intents it finds on the phone, but the only entry I found for Simple Time Tracker was the main Activity com.example.util.simpletimetracker.ui.MainActivity.

I also tried sending Intents to the debug app shared in #11, but the same errors occurred in both MacroDroid and Shortcube Maker whether or not the debug string was in the package name or the Action field.


Android Versions: 7.0, 10.0 (tested on an old Galaxy S6 and a Google Pixel 1st Gen) SimpleTimeTracker Version: 1.21, the debug app (shows 1.19)

Let me know what other data points I can share to help debug the issue!

Razeeman commented 1 year ago

Hello!

In Macrodroid intent's target probably should be "Broadcast", it's not shown in the attached screenshots but it seems that the "Activity" is selected. I've tried with "Broadcast" and it works.

As for Shortcut Maker it seems that it is currently capable of sending intents only to activity targets and not broadcasts. I've found a question in telegram chat about sending Broadcast intents and the developer said that it is not supported, but maybe they will add it in the future.

Hope this helps!

thehale commented 1 year ago

Wow! I thought I had tried all three options in that drop down (Activity, Broadcast, and Service), but I guess I missed something. Broadcast mode in MacroDroid now works like a charm!

As a result I have also successfully triggered time tracking from WearOS via MacroDroid's companion app which will serve as a viable path forward until WearOS is supported here, or until I can build my own.