android--创建快捷方式和判断是否已经创建
16lz
2021-01-23
一般android应用程序安装完成后是不会自动创建快捷方式的,所以可以自己在程序启动时实现。
需要权限 <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
和要点击快捷方式对应的那个activity的属性。
<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"></action>
</intent-filter>
如何判断快捷方式是否已经创建的方法,因为快捷方式信息是保存在com.android.launcher的launcher.db的favorites表中,所以可以查询此表得到,
需要权限<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
下面给个例子分享给各位:
更多相关文章
- ListView的一些属性
- Android 属性动画Property Animation(下)
- 关于android的animation的xml定义中的android:interpolator属性
- Netty实战(三)Unity程序采用netty和其他netty程序通信
- android1.6新增SD卡写权限WRITE_EXTERNAL_STORAGE
- Android 程序执行Linux命令的解决方法及注意事项
- android系统权限SET_PREFERRED_APPLICATIONS怎么获取