AndroidShortcuts
来源:互联网 发布:足球关注分析软件 编辑:程序博客网 时间:2024/05/01 16:46
AndroidShortcuts
项目地址:pcevikogullari/AndroidShortcuts
简介:Example app for shortcuts in design library v25
Example app for shortcuts in design library v25
Demo
Manifest
Add meta-data before </activity>
tag in Manifest.xml
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
Add Shortcut
To add or edit a new shotcut, go to /res/xml/shortcuts.xml :
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"> <shortcut android:shortcutId="shortcut1" android:enabled="true" android:icon="@drawable/ic_directions_run_black_24dp" android:shortcutShortLabel="@string/shortcut1" android:shortcutLongLabel="@string/shortcut1_long" android:shortcutDisabledMessage="@string/shortcut1_disabled"> <intent android:action="custom_action" android:targetPackage="com.pamir.shortcuts" android:targetClass="com.pamir.shortcuts.MainActivity" /> </shortcut></shortcuts>
Handle Actions
To handle shortcuts, just add new constant:
private final static String CUSTOM_ACTION = "custom_action";
and check the intent for custom action :
switch (getIntent().getAction()){ case CUSTOM_ACTION: textView.setText(CUSTOM_ACTION); break; default: break; }
0 0
- AndroidShortcuts
- AndroidShortcuts使用详解
- java:通过Semaphore构建对象池
- macos阻止硬盘休眠
- iOS 调取本地地图以及三方地图
- win32之简易记事本
- 玩转Google开源C++单元测试框架Google Test系列(gtest)之六 - 运行参数
- AndroidShortcuts
- distinct和group by的效率
- 一个c++转c的工具(cfront源码)
- 解决VS2015无ReportViewer和Rdlc的问题
- java 类加载器
- js字符串截取函数slice()、substring()、substr()
- http协议
- [RK3288][Android6.0] USB hub初始化流程小结
- 设置圆角背景边框的的按钮