有时候如果想让我们的应用在桌面上创建多个快捷方式,我们可以在Manifest.xml文件中对相应的activity进行声明。

<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light" >
<activity
android:name=".PullToRefreshListActivity"
android:label="PtR ListView" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".PullToRefreshGridActivity"
android:label="PtR GridView" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".PullToRefreshExpandableListActivity"
android:label="PtR ExpandableListView" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".PullToRefreshWebViewActivity"
android:label="PtR WebView" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

代码如上,这是从PullToRefresh的demo中看到的,因为我们一般的应用安装完成后,都只会生成一个快捷方式,但是这个应用却生成了四个,查看了Manifest.xml才发现这个东西,记录①下,可能会有用。

为Activity生成桌面快捷方式的更多相关文章

  1. Inno Setup生成桌面快捷方式

    在做项目的时候,需要打包成exe安装包.先前使用的是vs来打包,生成了setup.exe 和 *.msi的安装文件,不过也算顺利. 后因为要求采取 Inno Setup来打包程序,其中遇到个创建快捷方 ...

  2. 利用ios safari浏览器生成桌面快捷方式并唤醒app的示例代码

    html 内容: //通过a链接唤醒app  <a href="app约定好的scheme" id="qbt" style="display:n ...

  3. PHP生成桌面快捷方式,保存一个网页至桌面上成为快捷方式

    header("Content-Type: application/octet-stream; charset=utf8"); header("Content-Dispo ...

  4. QQ是怎样实现好友桌面快捷方式的?

    QQ是怎样实现好友桌面快捷方式的? 不知道什么时候,QQ推出了好友桌面快捷方式.方便用户和最常保持联系的好友一键联系.核心功能一:若QQ启动了.则双击快捷方式直接打开好友聊天界面:核心功能二:若QQ未 ...

  5. php生成网页桌面快捷方式

    本文将介绍使用PHP生成网页桌面快捷方式的代码,并添加图标及解决不同浏览器保存出现的乱码问题. 我们访问网站时,如果网站的内容很有吸引,一般我们都会使用浏览器的收藏夹功能,收藏此网站. 在浏览器收藏的 ...

  6. android桌面快捷方式跳转到指定activity

    AndroidManifest.xml 应用主入口配置: <activity android:name="com.*.cust.contacts.MainActivity" ...

  7. Android 点击桌面快捷方式和Notifycation跳转到Task栈顶Activity

    我们一般下载的应用在第一次启动应用的时候都会给我创建一个桌面快捷方式,然后我在网上找了些资料整理下了,写了一个快捷方式的工具类,这样我们以后要创建快捷方式的时候直接拷贝这个类,里面提供了一些静态方法, ...

  8. Android创建桌面快捷方式

    在桌面上创建特定界面的快捷入口,icon和title根据请求参数命名.在网上收集的一些相关资 料,在使用intent发送广播的时候,一些型号的收集会有问题,如魅族MX,红米,以及华为,使用setCla ...

  9. Android桌面快捷方式那些事与那些坑

    原文来自http://blog.zanlabs.com/2015/03/14/android-shortcut-summary/ 将近二个多月没写博客了.之前一段时间一直在搞红包助手,就没抽时间写博客 ...

随机推荐

  1. 使用malloc分别分配2KB的空间,然后用realloc调整为6KB的内存空间,打印指针地址

    #include<stdio.h> #include<stdlib.h> #include<string.h> #include<malloc.h> i ...

  2. node之版本号升级和管理

    如今非常多人预计和我一样项目中已经開始应用起nodeJS,而伴随着项目的需求,对nodejs版本号也有着各种需求.好了直接进入主题,如今node版本号管理网上有非常多方式.这里说两种: 第一种modu ...

  3. hdu1213 How Many Tables(并查集)

    How Many Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  4. 深入浅出Struts2

    Struts2简单介绍 Struts 2框架作为Struts 1.X框架的替代技术,相对Struts 1.X来说,有着本质上的改变. Struts 2框架是从WebWork框架发展而来的.Apache ...

  5. 去除iframe滚动条1

    主页面的IFRAME中添加:scrolling="yes" 子页面程序代码: 让竖条消失: <body style='overflow:scroll;overflow-x:a ...

  6. oracle rac 巡检过程详解

    一 RAC环境 RAC架构,2节点信息 节点1 SQL> show parameter instance NAME                                 TYPE    ...

  7. jsp页面String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";作用!!!!!

    转自:https://blog.csdn.net/kiwangruikyo/article/details/81130311 <%String path = request.getContext ...

  8. C#调用GPG命令进行加密解密文件操作

    public void GPG() { string password = "1234567890"; System.Diagnostics.ProcessStartInfo ps ...

  9. js小知识colspan和rowspan

    colspan和rowspan这两个属性用于合并表格的列或者行. colspan是"column  span"(跨列)的缩写,所以colspan属性用在td标签中,用来跨列合并单元 ...

  10. 用Beamer做Slides

    学术用幻灯片,首选还是latex.但是问题来了,Beamer这个latex幻灯模板还需要很多自定义设置.于是找了网上一些自己觉得好的例子. http://www.latexstudio.net/ind ...