
Funny Chronometer
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.😂😂