如何创建这导致非发射活动的捷径? [英] how to create a shortcut which leads to a non-launcher activity?

查看:123
本文介绍了如何创建这导致非发射活动的捷径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Android应用程序的快捷方式,它会导致另一个活动是不是该应用程序的启动。

I want to create a shortcut in an android app, it lead to another activity which is not launcher of the app.

推荐答案

要创建快捷方式本身,你需要特制的活动必须:

To create the shortcut itself you need a specially crafted activity which must:

  • 在你的Andr​​oidManifest.xml中定义的意图过滤器的作用android.intent.action.CREATE_SHORTCUT。
  • 返回一个结果,一个Intent,包含您的实际的快捷键。快捷方式本身是另一个意图psented重新$ P $。

此活动将然后才显示出来,当你长时间preSS你的桌面,并选择快捷方式。

This activity will then show up when you longpress your desktop and select "Shortcuts".

当然的快捷方式本身是没有多大用处,所以你必须添加一个意图过滤器的任何活动中,你想要得到的快捷键触发。这样做的目的过滤器应符合您选择您的快捷方式的任何意图。

Of course the shortcut by itself is not much use, so you must add an intent filter to whatever activity you want to get triggered by the shortcut. The intent filter should match whatever Intent you chose for your shortcut.

我写了一个小的how-to关于这个问题,它有更多的细节:<一href="http://www.kind-kristiansen.no/2010/android-adding-desktop-shortcut-support-to-your-app/">http://www.kind-kristiansen.no/2010/android-adding-desktop-shortcut-support-to-your-app/

I wrote a small how-to on the subject, it's got more details: http://www.kind-kristiansen.no/2010/android-adding-desktop-shortcut-support-to-your-app/

别告诉我,如果有什么不清楚在该职位,我会尽力把它清除掉。

Do tell me if anything is unclear in that post, I'll try to clear it up.

这篇关于如何创建这导致非发射活动的捷径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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