How to make buttons [pt2] | Android Development Tutorial

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,322
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 8, 2011

In this tutorial I show you how to program your buttons more efficiently in your activity. You just add your button to your apps graphical layout, then program your buttons onclicklistener in java.

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (androidprek)

  • Try setting your API level to 10, aka (gingerbread 2.3.3). Also make sure your SDKs and Eclipse are up to date.

see all

All Comments (14)

Sign In or Sign Up now to post a comment!
  • @karter61 same here...setOnClickListener underlined...

  • works great! thanks

  • @karter61 yea, it doesn't work; nevermind

  • @karter61 change "this" to "null"

  • In my program the App crashes when I write it like this and if I write @Override bevor the onClick(View v) it is an error too. Whats wrong?

  • When I write the same as you, I get this error:

    btn1.setOnClickListener(this);

    (with setOnClickListener underlined)

    Can you help me?

  • what about toggle button?

  • thank you very much gud job man keep it up

  • Instead of making the button pop-up a toast message, how do I make the buttons link to different pages in the layout.

  • much better than the first way. I got stuck with the first way also because the comp I was on could only handle API 7 and down. now I'm on a comp with 4gb of RAM and a real processor. but because no error message comes up in eclipse letting you know that, I was sort of guessing until I got on a better machine. anyway, I'm loving the videos and learning alot. this is a godsend actually. keep em coming!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more