zoukankan      html  css  js  c++  java
  • 暗码启动应用

    1.输入*#*#1001#*#*就可以启动某个应用

    2.AndroidManifest.xml配置

    <application  
            android:icon="@drawable/ic_launcher"  
            android:label="@string/app_name"  
            android:theme="@style/AppTheme" >  
            <activity  
                android:name=".MainActivity"  
                android:label="@string/title_activity_main" >  
                <intent-filter>  
                    <action android:name="android.intent.action.MAIN" />  
      
                    <category android:name="android.intent.category.LAUNCHER" />  
                </intent-filter>  
            </activity>  
            <receiver android:name="Cipher">    
                <intent-filter android:label="@string/hello_world">  
                    <action android:name="android.provider.Telephony.SECRET_CODE"/>    
                    <!-- *#*#1001#*#* -->    
                    <data android:scheme="android_secret_code" android:host="1001"/>    
                </intent-filter>    
            </receiver>  
        </application>  
    

      

    3.java代吗

    package com.example.anma;  
      
    import android.annotation.SuppressLint;  
    import android.content.BroadcastReceiver;  
    import android.content.Context;  
    import android.content.Intent;  
      
    @SuppressLint("ParserError")  
    public class Cipher extends BroadcastReceiver {  
      
        @Override  
        public void onReceive(Context arg0, Intent arg1) {  
            if (arg1.getAction().equals  
      
            ("android.provider.Telephony.SECRET_CODE")) {  
                Intent i = new Intent(Intent.ACTION_MAIN);  
                i.setClass(arg0, MainActivity.class);  
                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
                arg0.startActivity(i);  
            }  
        }  
      
    }  
    

      

  • 相关阅读:
    5-JVM常用的命令
    4-JVM 参数
    3-JVM垃圾回收算法和垃圾收集器
    2-JVM内存结构
    1-JVM基础
    非常短的git学习笔记
    白话马尔科夫链蒙特卡罗方法(MCMC)
    写了个小游戏,来玩
    胡小兔的 高考2019 游记
    机房志 | 一篇中二的文章
  • 原文地址:https://www.cnblogs.com/xiayexingkong/p/6530605.html
Copyright © 2011-2022 走看看