添加秘密程序,通过拨号启动
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 加法程序
  3. Android按返回键弹出对话框退出应用程序
  4. 【从头学android】第一个程序,点按钮显示Hello World
  5. 〖Android〗酷派手机固件.cpb文件的分解程序
  6. 如何制作Android手电筒程序
  7. Android应用程序获取ROOT权限的方法(android中如何通过代码检测
  8. Android MediaPlayer Playback---多媒体开发应用程序接口

随机推荐

  1. Android中为什么主线程不会因为Looper.lo
  2. Android 关于RatingBar评分条
  3. Android ORM 框架之 Android中ORMLite应
  4. Android Studio 环境搭建 与相关问题解决
  5. Xamarin.Android 上中下布局
  6. Mac下搭建 Android(安卓)反编译环境
  7. android sample之Notepad(带下划线的Test
  8. Android MediaCodec H264编码设置Main Pr
  9. 在 Eclipse 中导入 Android 示例程序
  10. Android 横竖屏切换时候重新进行数据请求