android: onClick vs setOnClickListener



In this tutorial, we will learn how android: onClick XML in Android Studio works under the hood, how it differs from the OnClickListener setting in Java code, and which one you should use in your project.

____________________
❗ Subscribe to the channel:

⏯ See more …

24 Comments

  1. Reply

    Im a beginner
    Trying to get the code for the following situation
    Edittext1 = current stock of proteinbars Edittext2 = daily consumed proteinbars
    Textview1 (days left) = how many days i have left ( edittext1 / editext2 )
    Textview2 (Reorder date) = current date + textview1 – 7 days (delivery time)
    Reorder date displayed

  2. Reply

    Hey Buddy! ….. I want to learn android coding and build apps, which of the video tutorials of your channels should i watch first and which things i have to practice a lot. ….. reply must..

  3. Reply

    This video is just in time for me! I'm updating an old Android app and I couldn't remember the semantics of the onClick attribute. I can't believe the implementation waits for an event to verify the reflection! They seriously need to deprecate the onClick attribute. Thanks!

  4. Reply

    This video is just in time for me! I'm updating an old Android app and I couldn't remember the semantics of the onClick attribute. I can't believe the implementation waits for an event to verify the reflection! They seriously need to deprecate the onClick attribute. Thanks!

  5. Reply

    Lately i've been using one instance of View.OnClickListener which has a switch statement and acts accordingly depending on view.getID and passing it to all my views with desired click events, mainly for code maintenance purposes. do you think it is a good approach?

  6. Reply

    Wow great tutorial like always. Just a small doubt , Wouldn't it be better for activity to implement onClickListener and button to call setOnClickListener(this) . This way we won't create new onclicklisteners for each button .

  7. Reply

    Do you know if any of the other technologies for both platforms ios and android like flutter and so on can create programs for the internet of things?

  8. Reply

    Hello Florian another great video love this one too…i again need Ur help Florian…actually I come across music player development… And I saw this topic that use Services for music player like play,pause,next,previous,volume etc…can you please guide me on this topic…guest help is also appreciate… Thank.

  9. Reply

    hi florian, i really enjoy your tutorials on android development.. but i had a question, i hope you don't mind if i ask from where did you learn android development? Was it from uni or books or something else? you're really good and i was just curious

Leave Comment

Your email address will not be published. Required fields are marked *