<receiver android:name="com.test.HiddenKeyReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data android:scheme="android_secret_code" android:host="1234567890" />
</intent-filter>
</receiver>
public static final String STRING_CODE= "android.provider.Telephony.SECRET_CODE";
@Override
public void onReceive(Context context, Intent intent)
{
if (intent.getAction().equals(STRING_CODE))
{
Intent i = new Intent(Intent.ACTION_MAIN);
String host = intent.getData().getHost();
if ("1234567890".equals(host)) i.setClass(context, startActiviy.class);
}
}
댓글 영역