Android App Development for Beginners – 27 – Listening for Button Clicks

Share it with your friends Like

Thanks! Share it with your friends!

Close

Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/category.php?id=10

My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS

Comments

Alex Speedy says:

bucky uses buttonClicked(v); instead buttonClicked(); in OnClickListener.
why ? :D

Shubhanshu Rajput says:

On 5:13 and line no 27 why u use new View.onClickListner but not new Button.onClickListener

Geometry Dash AJ213 says:

Hey can someone tell me the basics of .core Java or send me a link to a website explaining it? I just realized it would make learning this easier.

Geometry Dash AJ213 says:

If A=B and B=C Then A=C

Ronit Ghosh says:

why did you use new View.onClickListener instead of new Button.onclickListener?

Suyash Shrivastava says:

why did he used newView.onClickListener instead of newButton.onclickListener?

Dajan Brackovic says:

so the button is just gonna be chillin there waiting for something to happen
OG PROGRAMMING SKILLS

The African House Movement says:

Fight club rules……

Tech Nique says:

Sorry if this is a noob question, but i am getting confused at the view function. Can someone explain to me about the difference between (View v) and (View view). Also why is (v) passed for button clicked? Can I use any other variable?

soham bandyopadhyay says:

Very nice! Very nice!

JLBGreenBay says:

Loving these tutorials! Thanks for all the help +thenewboston !

Aditya Joglekar says:

why is the reference to button final? also, why is the button refererence a local variable of OnCreateView? shouldn't it be a class attribute?

Ashit Shrivastava says:

fragment club lol!!

anon9180 says:

love the reference to fight club

Nikhil Latkar says:

what is the defference between making an onclick inside onCreate using the long way AND just writing the method directly in the class n then setting that method as onClick="methodName" in the xml file ??
i mean why use the long way when we can write a method directly in the class n use it ??

Write a comment