Open wunter8 opened 1 year ago
This code works for launching an app based on the given package and class, but I only tested it with the android.intent.action.MAIN
intent. I didn't check or test any other cases, and I am just blindly assuming right now that if action.intent_package
and action.intent_class
are set, it should always use ctx.startActivity
instead of ctx.sendBroadcast
I'll just leave this code here in case we decide to pick it up again in the future.
Agreed. I do think it has been requested more than once though. But if we do it, we definitely want to do it the right way
I don't think I'm going to finish this. Apparently when you use the
android.intent.action.MAIN
intent, you have to usectx.startActivity
instead ofctx.sendBroadcast
. (See https://developer.android.com/reference/android/content/Intent#standard-activity-actions)So to do it "right", I think we'd need to compare
action.intent
to everything in that list of standard activity actions. If it's in the list, usectx.startActivity
. If it's not in the list, usectx.sendBroadcast
. But at that point, this becomes a much bigger PR and it has only been requested once so far.I'll just leave this code here in case we decide to pick it up again in the future.