In this video we will build a stopwatch that we can start, pause, resume and reset with help of the Chronometer widget. Chronometer is a subclass of TextView …




  1. nouf ba fadhl Reply

    this is what i want someone who explains everything thank uuuuuu <3 <3 <3

  2. Alex Jones Reply

    Good tutorial! Straight to the point and we'll explained. Thank you !

  3. Khadija Hameed Reply

    Thank u so much.. It's so easy and perfectly working

  4. even you talked about the issue for …setBase I had, Wonderful!!!!

  5. Great as always sir, When I´m looking for a piece of code, you´re always there. thanks!

  6. This is nice tutorial. But i want to ask you, when i start the stopwatch my app is going to exit and keep stoping or its called crash. How can i fix it?

  7. Code Flick Reply

    my code showing error: Attempt to invoke virtual method 'void android.widget.Chronometer.setBase(long)' on a null object reference
    at com.gaur.alarmclock.StopWatch.onClickPlay(

    at com.gaur.alarmclock.StopWatch.onClick(

  8. Hi i'm korean university student and my grade is sophomore 🙂 i study chronometer for my final test, your Chronometer Tutorial video is so good, but i don't know why you use 'Pauseoffset'

    What do you means about 'Pauseoffset' ? can you explain easily about it? i can't speak english well but i really know about 'Pauseoffset' Thanks 🙂

    Have a nice day

    Ah! I know about it!! your video is so useful and i understand perfectly about your code very thank you for your video 😘

  9. Haroon Ahmed Reply

    Is there any way to save the elapsed time every time you press stop to firestore database?

  10. why do i keep getting

    Incompatible Types
    Required: android.widget.Chronometer

    Found: android View view

    Please help, thank you

  11. Aliton Oliveira Reply

    Does Default Phone App have a chronometer like you showed in your tutorial or another kind of method to count the time of the answered call?

  12. Huseyin Tunc Reply

    Hey! Nice tutorial video thank you. May i ask a question ? I did chronometer like you did. But i want me to alarm in specific time. Your code is correct but when i write that " if((SystemClock.elapsedRealtime() – chronometer.getBase()) ==
    (300000 – currentrune*1000)){

    Toast.makeText(getActivity(), "Alarm",


    currentrune is a variable that take an int value between 0 and 35. Let's say currentrune is 20. So it has to give me warning at 4:40.
    it doesn't work. If i change >= this it is making toast constantly after 4:20. How can i do that ? (Make things in specific time ) Thank you.

  13. how to run the Chronometer
    timer in background using services..

  14. Mecin Channel Reply

    helo how about if I want second . minut and hours?
    what should I do bro

  15. How can I store the time in a variable? ex: after I pressed a button.

  16. Great Video Bro! However I still have questions on how to get the value of the time in seconds to save in Firebase?

  17. Peter Aleksander Bizjak Reply

    Nice one! I'm building a timer during audio recording. I saw your video, opened it immediately, no hesitation. You and Mitch Tabian are life savers!

  18. Aidan Power Reply

    You sir are a legend. Tutorials are so straightforward and easy to follow

  19. Berto Gonzalez Reply

    Has anybody else experienced onChronometerTick only being called once and never again? I'm trying to keep a running total of the chronometer time, but it only increments on the very first second!

  20. Bashir Khadra Reply

    Can you make a video on how to make a stopwatch with milliseconds thx

  21. Mobile Apps Reply

    Hi, I'm a beginner in Java progamming and I'm kindly asking for some help in saving chronometer value (elapsed time) in shared preferences as per the video. I have understood how to save string/text values but not how to save Long data type. Please help.Thank you.Ps. Please also explain how to get the elapsed time Long value too.

    my email:

  22. You have some of the best tutorials I have ever seen. Subbed!

  23. Raju Ghosh Reply

    Hi sir please add feature of timer based points in your quiz application

  24. EibeMandel Reply

    Can you make a tutorial on how to display the timer in an ongoing notification like on the stock clock app? I tried using a foreground service but after a few minutes in the background the timer would just stop :/

Write A Comment