Skip to content

Instantly share code, notes, and snippets.

@jdamcd
Created February 16, 2013 11:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jdamcd/4966518 to your computer and use it in GitHub Desktop.
Save jdamcd/4966518 to your computer and use it in GitHub Desktop.
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