首頁 收藏 QQ群
 網(wǎng)站導(dǎo)航

ZNDS智能電視網(wǎng) 推薦當(dāng)貝市場

TV應(yīng)用下載 / 資源分享區(qū)

軟件下載 | 游戲 | 討論 | 電視計(jì)算器

綜合交流 / 評(píng)測 / 活動(dòng)區(qū)

交流區(qū) | 測硬件 | 網(wǎng)站活動(dòng) | Z幣中心

新手入門 / 進(jìn)階 / 社區(qū)互助

新手 | 你問我答 | 免費(fèi)刷機(jī)救磚 | ROM固件

查看: 12417|回復(fù): 0
上一主題 下一主題
[教程]

添加秘密程序,通過撥號(hào)啟動(dòng)

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2013-8-28 16:30 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
4添加秘密程序,通過撥號(hào)啟動(dòng)   
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>   

上一篇:格式化SD卡/卸載SD卡
下一篇:非遞歸方法枚舉目錄下所有文件(含子目錄)
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

Archiver|新帖|標(biāo)簽|軟件|Sitemap|ZNDS智能電視網(wǎng) ( 蘇ICP備2023012627號(hào) )

網(wǎng)絡(luò)信息服務(wù)信用承諾書 | 增值電信業(yè)務(wù)經(jīng)營許可證:蘇B2-20221768 丨 蘇公網(wǎng)安備 32011402011373號(hào)

GMT+8, 2024-9-24 17:18 , Processed in 0.059206 second(s), 16 queries , Redis On.

Powered by Discuz!

監(jiān)督舉報(bào):report#znds.com (請(qǐng)將#替換為@)

© 2007-2024 ZNDS.Com

快速回復(fù) 返回頂部 返回列表