首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有am命令的

带有am命令的
EN

Stack Overflow用户
提问于 2022-03-29 15:29:59
回答 1查看 89关注 0票数 0

在我的安卓手机上,我想用奥斯曼德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.MapActivity
  • am broadcast osmand.api://stop_navigation

我还用大写字母测试了它。但没有一项命令成功。

有没有人有更多的经验,使用android意图和/或osmand,并能帮助我如何创建一个工作命令?

提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2022-03-29 15:50:43

我已经找到了解决办法,比预期的要简单。也许我可以帮别人解决这个问题:

命令am start osmand.api://pause_navigation就足够了。

顺便说一句:termux-open osmand.api://pause_navigation也能工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71664865

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档