Android快速捷径[在shortcuts.xml中传递意图的额外(或一些数据)] [英] Android Quick shortcuts [passing intent extra(or some data) in shortcuts.xml ]

查看:431
本文介绍了Android快速捷径[在shortcuts.xml中传递意图的额外(或一些数据)]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用shortcut.xml实现静态快捷方式的同时,我想传达一些捆绑包附加信息.

While implementing the static Shortcuts using shortcut.xml, i would like to pass few bundle extras with my intent.

需要传递的额外内容来确定目标类中的少数功能.

need the passed extras to decide on few functionality in the target class after launching the app.

是否可以使用其他功能?如何以及在何处访问它?

is it possible to access the extras? how and where to access it?

任何线索都将受到高度赞赏

Any leads would be highly appreciated

推荐答案

我不确定是否还有其他方法,但是我使用这种方法:

I'm not sure if there is another way, but I use this:

<intent
        android:action="android.intent.action.VIEW"
        android:targetPackage="target.package"
        android:targetClass="activity.with.package">
        <extra android:name="extraID" android:value="extravalue" />
</intent>

然后,您可以照常使用其他功能.

Then you can access extras as usual.

这篇关于Android快速捷径[在shortcuts.xml中传递意图的额外(或一些数据)]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆