4

The public method isTheFinalCountDown just opens a YouTube video for the song The Final Count Down.

All the doc has to say about it is this:

whether this is the final countdown

Since this is a public api, what would be a real world use-case for this method. Or is it just another easter egg like the isUserAGoat function?

MadScientist
  • 2,134
  • 14
  • 27

2 Answers2

5

https://www.reddit.com/r/androiddev/comments/6yti73/easter_egg_from_google/

in API 26 Google devs added new public method "isTheFinalCountDown" to class "Chronometer". If you will run this method in your app it will open YouTube video of the rock band Europe - The final Countdown

Karan Harsh Wardhan
  • 1,096
  • 9
  • 22
0

To add some detail to the accepted answer, it uses Chronometer's Context to launch an Activity with an intent filter matching:

  • Action:Intent.ACTION_VIEW and a youtu.be uri
  • Category: Intent.CATEGORY_BROWSABLE presumably as a fallback if you don't have youtube installed

Here is the implementation ‍

/**
 * @return whether this is the final countdown
 */
public boolean isTheFinalCountDown() {
    try {
        getContext().startActivity(
                new Intent(Intent.ACTION_VIEW, Uri.parse("https://youtu.be/9jK-NcRmVcw"))
                        .addCategory(Intent.CATEGORY_BROWSABLE)
                        .addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT
                                | Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT));
        return true;
    } catch (Exception e) {
        return false;
    }
}
HenriqueMS
  • 3,864
  • 2
  • 30
  • 39