Built-in dial pad password, start the application

Time:
Before 2020/08/31, the company does not allow csdn, and the notes are written elsewhere. recently tidied up

There are 2 ways to activate the password:

1. Listen to the broadcast that comes with Android, set the corresponding password, and start the application after receiving the broadcast.
2. Start the application by listening to the input content of the dial pad.

broadcasting method

1. AndroidManifest.xml file configuration, register a receiver, add Intent filter conditions

<receiver android:name="Me">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE"/>
<!-- *#*#1024#*#* -->
<data android:scheme="android_secret_code" android:host="1024"/>
</intent-filter>
</receiver>

2. Create a class to receive broadcasts

Start the application when the action of the Intent is "android.provider.Telephony.SECRET_CODE"

reference

https://blog.csdn.net/qq3162380/article/details/45393335

Guess you like

Origin blog.csdn.net/a396604593/article/details/129797355