android如何通过拨号界面打开隐藏界面
2016-08-19 18:20
267 查看
一. SpecialCharSequenceMgr.java 的 handleSecretCode 方法会处理以*#*#开头,以#*#*结尾的字符串,源码如下
二. 在我们自己的代码中监听对应的广播消息,代码如:
static boolean handleSecretCode(Context context, String input) { // Secret codes are in the form *#*#<code>#*#* /// M: for plug-in @{ input = ExtensionManager.getInstance().getDialPadExtension().handleSecretCode(input); /// @} int len = input.length(); if (len > 8 && input.startsWith("*#*#") && input.endsWith("#*#*")) { final Intent intent = new Intent(SECRET_CODE_ACTION, Uri.parse("android_secret_code://" + input.substring(4, len - 4))); context.sendBroadcast(intent); return true; } if(input.equals("*#6813#")) { Intent intent = new Intent(SECRET_CODE_ACTION, Uri.parse("android_secret_code://" + input.substring(2, len - 1))); context.sendBroadcast(intent); return true; } return false; }
二. 在我们自己的代码中监听对应的广播消息,代码如:
<receiver android:name="lyps.SecretReceiver" > <intent-filter> <action android:nam 4000 e="android.provider.Telephony.SECRET_CODE" /> <data android:host="33221985" android:scheme="android_secret_code" /> </intent-filter> </receiver>
相关文章推荐
- android中通过拨号键打开contacts相关界面的流程分析
- android中通过拨号键打开contacts相关界面的流程分析
- Android中关于如何从一个Activity跳转到拨号界面,或者直接到通话中
- android 如何打开系统联系人界面
- Android 如何通过浏览器打开App
- 如何在android手机上实现app开机自动运行启动(可以打开应用界面)。
- 如何控制Android软件盘的打开与隐藏
- android开发如何控制虚拟键盘的打开和隐藏
- 在Android中如何通过点击edittext之外的部分使软键盘隐藏
- 在Android中如何通过点击edittext之外的部分使软键盘隐藏
- android 如何打开系统联系人界面
- android如何打开系统wifi、蓝牙等设置界面
- 如何在android的开发中打开系统设置界面
- Contacts---android 如何打开系统联系人界面
- android 如何通过包名打开其他应用
- android 如何打开系统联系人界面
- 详细讲解如何用Cocos2dx3.0alpha0搭建跨平台项目,并通过cygwin部署android项目,并在eclipse打开。
- 如何控制Android软件盘的打开与隐藏
- Android 编程日记 如何通过包名打开一个应用程序
- 通过程序打开Android常用系统设置界面