android实现快捷方式
来源:互联网 发布:爱淘宝每日3次抽红包 编辑:程序博客网 时间:2024/04/29 22:54
使用android手机的都知道,当长按着桌面的时候,会弹出“添加到主屏幕”的选项,在“快捷方式”里面有很多的应用,其中有的可以添加快捷方式,有的就不可以。
其实最关键的方法就是:
在AndroidMainfest,xml文件中的主ACTIVITY添加:
<intent-filter >
<action android:name="android.intent.action.CREATE_SHORTCUT"/>
</intent-filter>
在添加权限:
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
集成下来就是如下所示:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ljz.shortcut.demo1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".ShortCutDemo1Activity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.CREATE_SHORTCUT"/>
</intent-filter>
</activity>
</application>
</manifest>
- android实现快捷方式
- Android创建快捷方式实现
- Android桌面快捷方式的实现
- Android桌面快捷方式的实现
- Android 实现应用程序添加快捷方式
- Android桌面快捷方式的实现
- Android桌面快捷方式的实现
- android实现应用程序无图标(快捷方式)问题.
- android实现应用程序无图标(快捷方式)问题
- Android 快捷方式
- Android 快捷方式
- Android 快捷方式
- Android 快捷方式
- Android 快捷方式
- android 快捷方式
- ANDROID快捷方式
- Android 快捷方式
- Android快捷方式
- wince使用sim卡上网
- 自己珍藏的网址 学习用
- 毁人不倦 - 许嵩 - 苏格拉没有底
- 51汇编语言指令集
- 多线程详解
- android实现快捷方式
- poj 1220 java大数类
- setInterval和clearInterval
- 为你的网站添加小图标Favicon.ico
- SlideringDrawer的使用(抽屉效果)
- 神通的类别--转载
- 可恶到的IE6因浮动引起的字符自动复制BUG
- 图像处理与计算机视觉:基础,经典以及最近发展(2)图像处理与计算机视觉相关的书籍
- x&(x-1)含义