Open ildar opened 7 years ago
Yes, definitely. In order to support this, The first thing is to extend the "send broadcast" operation to allow editing categories, data, and MIME.
Then, I'm not sure which way will be better:
Also, I'm planning to change the profile editing page/dialog so users can "add" operations from a list, instead of the current "selected or not selected" way. I'm thinking of which way would be more natural.
First part is already done. We can now manually set categories (seperated by newlines), data and MIME type in addition to action.
Any suggestions on how to design the second part?
An example (or better a few different examples) would help. Can you drop a link or plain text examples right here?
You mean using existing intents?
Here are a few examples given by official documents.
One example may be:
Action:
android.intent.action.DIAL
Data:tel:123123
meaning dial the phone number 123123
Ok, many thanks for your informative answer. :-)
Hi, is this still waiting to be implemented?
It should work AFAIK. Did you try?
I couldn't get it to work. Maybe I understand intents wrong, but I came to the conclusion that broadcasts and intents to start activities are different things.
I am trying to activate SD Scanner from easier but cannot make it. In the link is a description for how to activate with Tasker, I hoped I could do it similarly with Easer.
I'd suggest:
@ildar thank you for your support.
com.gmail.jerickson314.sdscanner.MainActivity
. It crashes the same as 1.
04-02 21:05:45.951 E/AndroidRuntime(17325): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gmail.jerickson314.sdscanner/com.gmail.jerickson314.sdscanner.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
$ am start -a android.intent.action.RUN -n com.gmail.jerickson314.sdscanner/.MainActivity
Starting: Intent { act=android.intent.action.RUN cmp=com.gmail.jerickson314.sdscanner/.MainActivity }
This is actually SD Scanner that crashes: https://github.com/jerickson314/sdscanner/issues/24 I see two things you could try:
...sdscanner/.MainActivity
versus ...sdscanner.MainActivity
You are right, it is SD Scanner that is crashing. But it should be possible to trigger the same action as am start
with Easer that is doing the correct thing.
Unfortunately am start
is not working via the command in Easer, its also not working in the LOS built-in terminal with the binary /system/bin/am
(it gives an exception that permission INTERACT_ACROSS_USERS_FULL is necessary). It is working in termux though, which brings its own flavor of am
.
Whoops, I didn't notice there is a conversation going on LOL .
Thank you a lot for the help @ildar . (Both of) Your discussions made the things more clear to me, and I think I have a conclusion / solution.
@iexos Have you tried not to write any class name in the Launch App Operation (i.e. only write the package name)? I just tested it on my side, and it works without crashing.
FYI, yes, as you have seen yourself, am start
and am broadcast
are two different things, as well as the Intent. In the Send Broadcast Operation, it just does broadcast, won't do "start activity" or "start service".
It seems a bit messy to have both functions in Send Broadcast Operation from my point of view, especially when "launch app" can have a selection of apps (not implemented yet, I have to admit) while send broadcast doesn't.
Maybe we should rename this issue as something like "allow to choose from pre-defined Intents"? Or just open another issue.
@renyuneyun thank you for clearing this up. I think I understand now what is going on.
Without the class name it starts the application as you would expect, but without performing the actual scan, as am broadcast -a android.intent.action.RUN -n com.gmail.jerickson314.sdscanner/.MainActivity
does
So as i understand it, the missing part would be to choose "action" for Launch App.
Actually there are many useful intents around and that would be great to have ability to "run" them