首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Android shortcuts快捷方式实现(支付宝长按图标弹出快捷方式入口)

建一个shortcut节点 <shortcut android:shortcutId="settings" android:enabled="true" android:icon...android:targetClass="hlq.view.activity.TestACtivity" /> shortcutId, 一个唯一的id enabled, 表示这个shortcut是否可用 shortcutShortLabel, 这里是配置的短名称, 下面还会有长名称...就显示短名称 shortcutLongLabel, 这里是配置的长名称, launcher会优先选择长名称显示 shortcutDisabledMessage, 这个配置是在我们选择一个不可用的shortcut...标签就可以了,最多可以配置5个 3.注册shortcut 像广播服务那样,需要在配置文件中声明编写的shortcuts,并且必须在默认启动的Activity中注册,如下: <activity android

2.5K10

Android O添加桌面快捷方式的示例

安卓N及以下版本: Intent addShortcutIntent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");//"com.android.launcher.action.INSTALL_SHORTCUT...屏幕上没有空间时会提示 // 注意:重复创建的行为MIUI和三星手机上不太一样,小米上似乎不能重复创建快捷方式 // 名字 addShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME...= null; scm.requestPinShortcut(si, null); } else { Intent addShortcutIntent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT...");//"com.android.launcher.action.INSTALL_SHORTCUT" // 不允许重复创建 addShortcutIntent.putExtra("duplicate...", false);// 经测试不是根据快捷方式的名字判断重复的 // 应该是根据快链的Intent来判断是否重复的,即Intent.EXTRA_SHORTCUT_INTENT字段的value

1.6K20

Android开发被添加到桌面快捷方式

大家好,又见面了,我是全栈君 Android开发被添加到桌面快捷方式 对于一个希望拥有很多其它用户的应用来说。用户桌面能够说是全部软件的必争之地,假设用户在手机桌面上建立了该软件的快捷方式。...因此,全部 Android程序都应该同意用户把软件的快捷方式加入到桌面上。 在程序中把一个软件的快捷方式加入到桌面上,仅仅须要例如以下三步就可以: 1....创建一个加入快捷方式的Intent该Intent的Action属性值应该为com.android.launcher.action.INSTALLSHORTCUT,。 2....) { // TODO Auto-generated method stub //创建一个加入快捷方式的Intent Intent addSC=new Intent("com.android.launcher.action.INSTALL_SHORTCUT...-- 指定加入安装快捷方式的权限 --> <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"

1.1K20
领券
http://www.vxiaotou.com