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. Good tutorial! Straight to the point and we'll explained. Thank you !

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

  4. 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?

  5. 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(

  6. 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 😘

  7. Haroon Ahmed Reply

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

  8. why do i keep getting

    Incompatible Types
    Required: android.widget.Chronometer

    Found: android View view

    Please help, thank you

  9. 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?

  10. 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.

  11. Mecin Channel Reply

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

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

  13. 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!

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

  15. 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!

  16. Bashir Khadra Reply

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

  17. 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:

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

  19. 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