Photo by Shawn Stutzman from Pexels

Funny Chronometer

Harshith Shetty
1 min readSep 11, 2018

So I had a task to implement a timer in my app, I just added a chronometer widget in my layout and was starting with implementation in my activity.

Thanks to the autocomplete, I saw two methods, isCountDown() and isTheFinalCountDown() and I wondered what exactly is different, which made me curious and I opened the source code, Chronometer.java and was really laughing at the implementation of latter.😂😂

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;
}
}

This method basically opened “Europe -The Final Countdown” music video on youtube.😂😂

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Harshith Shetty
Harshith Shetty

Written by Harshith Shetty

Mobile App Architect @Shaadi.com

No responses yet

Write a response