添加秘密程序,通过拨号启动
AndroidManifest.xml
<receiver android:name=".secret">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data android:scheme="android_secret_code" android:host="1234"/>
</intent-filter>
</receiver>

secret.java
public class secret extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String host = intent.getData() != null ? intent.getData().getHost() : null;

if (Intents.SECRET_CODE_ACTION.equals(action) && "1234".equals(host)) {
//start an acitivity
}
}
}

SECRET_CODE_ACTION
public static final String SECRET_CODE_ACTION Broadcast Action: A "secret code" has been entered in the dialer. Secret codes are of the form *#*##*#*. The intent will have the data URI:

android_secret_code://<code>



Intent intent = new Intent("android.provider.Telephony.SECRET_CODE",
Uri.parse("android_secret_code://" + "4636"));
sendBroadcast(intent);

更多相关文章

  1. android 启动延迟加载画面
  2. android里,addContentView()动态增加view控件,并实现控件的顶部,中
  3. Android点击通知栏消息,仅打开App,不跳转到具体Activity
  4. Android(安卓)简单的从本机获取相机功能 并且自动添加
  5. Android(安卓)PendingIntent和Intent
  6. Android下进行 Facebook 分享
  7. android MAT使用
  8. 关于用eclipse开发android经常出现R异常问题
  9. android中去掉标题栏和状态栏

随机推荐

  1. Android build system note
  2. android 拍照和从相册选择组件
  3. Android(安卓)消息机制
  4. How to create android splash screen
  5. Android获取安装包32位签名
  6. 2011.09.26(3)——— android sample之Note
  7. android 命名规范
  8. ListView设置分割线颜色
  9. Android Phone拨出电话流程
  10. Android API 中文 (55) —— ListAdapter