Activity中的setDefaultKeyMode()
2013-11-25 09:51
281 查看
如果在Activity中的onCreate()方法中使用setDefaultKeyMode()可以做到在当前activity中打开拨号器、执行快捷键、启动本地搜索、启动全局搜索。
这个启动啥,要看setDefaultKeyMode中传了啥参数,不同的参数见下:
[java] view
plaincopy
/**
* Use with {@link #setDefaultKeyMode} to turn off default handling of
* keys.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_DISABLE = 0; //如果设为这个,则在activity中按键的不做响应
/**
* Use with {@link #setDefaultKeyMode} to launch the dialer during default
* key handling.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_DIALER = 1; //如果设为这个,则在activity中按键会打开拨号器
/**
* Use with {@link #setDefaultKeyMode} to execute a menu shortcut in
* default key handling.
*
* <p>That is, the user does not need to hold down the menu key to execute menu shortcuts.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_SHORTCUT = 2; //如果设为这个,则在activity中按键会启动快键键
/**
* Use with {@link #setDefaultKeyMode} to specify that unhandled keystrokes
* will start an application-defined search. (If the application or activity does not
* actually define a search, the the keys will be ignored.)
*
* <p>See {@link android.app.SearchManager android.app.SearchManager} for more details.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_SEARCH_LOCAL = 3; //如果设为这个,则在activity中按键会打开本地搜索
/**
* Use with {@link #setDefaultKeyMode} to specify that unhandled keystrokes
* will start a global search (typically web search, but some platforms may define alternate
* methods for global search)
*
* <p>See {@link android.app.SearchManager android.app.SearchManager} for more details.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_SEARCH_GLOBAL = 4; //如果设为这个,则在activity中按键会打开全局搜索
这个启动啥,要看setDefaultKeyMode中传了啥参数,不同的参数见下:
[java] view
plaincopy
/**
* Use with {@link #setDefaultKeyMode} to turn off default handling of
* keys.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_DISABLE = 0; //如果设为这个,则在activity中按键的不做响应
/**
* Use with {@link #setDefaultKeyMode} to launch the dialer during default
* key handling.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_DIALER = 1; //如果设为这个,则在activity中按键会打开拨号器
/**
* Use with {@link #setDefaultKeyMode} to execute a menu shortcut in
* default key handling.
*
* <p>That is, the user does not need to hold down the menu key to execute menu shortcuts.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_SHORTCUT = 2; //如果设为这个,则在activity中按键会启动快键键
/**
* Use with {@link #setDefaultKeyMode} to specify that unhandled keystrokes
* will start an application-defined search. (If the application or activity does not
* actually define a search, the the keys will be ignored.)
*
* <p>See {@link android.app.SearchManager android.app.SearchManager} for more details.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_SEARCH_LOCAL = 3; //如果设为这个,则在activity中按键会打开本地搜索
/**
* Use with {@link #setDefaultKeyMode} to specify that unhandled keystrokes
* will start a global search (typically web search, but some platforms may define alternate
* methods for global search)
*
* <p>See {@link android.app.SearchManager android.app.SearchManager} for more details.
*
* @see #setDefaultKeyMode
*/
static public final int DEFAULT_KEYS_SEARCH_GLOBAL = 4; //如果设为这个,则在activity中按键会打开全局搜索
相关文章推荐
- Activity中的setDefaultKeyMode()
- Activity中的setDefaultKeyMode() (转载)
- Activity中的setDefaultKeyMode()
- Activity中的setDefaultKeyMode()基本用法
- Activity中的setDefaultKeyMode()基本用法
- 通过setDefaultKeyMode设置Activity的五种按键模式
- Activity中的setDefaultKeyMode()
- setDefaultKeyMode 用法介绍
- setDefaultKeyMode 用法介绍
- setDefaultKeyMode 用法介绍
- setDefaultKeyMode分析
- setDefaultKeyMode 用法介绍
- Android-setDefaultKeyMode方法
- setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT) 功能的验证 及其 源码实现分析
- setDefaultKeyMode 用法介绍
- Set Linux starts in multi-user mode as default.
- ?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
- dict.setdefault(key, default=None)
- cocos2d-x 简单类型的存储--UserDefault的get/setxxxForKey()方法
- debian locale: Cannot set LC_CTYPE to default locale: No such file or directory