在我的安卓手机上,我想用奥斯曼德api来控制奥斯曼。为了发送意图,我想使用亚行shell或termux中可用的am命令。
我可以用am start net.osmand.plus/net.osmand.plus.activities.MapActivity启动奥斯曼
在我的第一个测试中,我只想停止导航(命令:STOP_NAVIGATION)。
首先,我尝试了am start -a stop_navigation -n net.osmand.plus/net.osmand.plus.activities.MapActivity。结果是Starting: Intent { act=stop_navigation cmp=net.osmand.plus/.activities.MapActivity } Warning: Activity not started, its current task has been brought to the front,这是有道理的。
然后我测试了一些广播命令,例如:
am broadcast -a stop_navigation -n net.osmand.plus/net.osmand.plus.activities.MapActivityam broadcast osmand.api://stop_navigation我还用大写字母测试了它。但没有一项命令成功。
有没有人有更多的经验,使用android意图和/或osmand,并能帮助我如何创建一个工作命令?
提前感谢!
发布于 2022-03-29 15:50:43
我已经找到了解决办法,比预期的要简单。也许我可以帮别人解决这个问题:
命令am start osmand.api://pause_navigation就足够了。
顺便说一句:termux-open osmand.api://pause_navigation也能工作。
https://stackoverflow.com/questions/71664865
复制相似问题