Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Android snippet for hiding debug screens behind SECRET_CODE broadcasts sent via the dialler.
<receiver android:name=".SecretCodeReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data
android:scheme="android_secret_code"
android:host="1111" />
</intent-filter>
</receiver>
public class SecretCodeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent i = new Intent(context, SecretActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment