Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Android 2.x SDK --- Button --- onClick Event Handler

Loading...

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

Uploaded by on Mar 6, 2010

Section 12.2c12 ... import android.view.View.OnClickListener; import android.widget.Button;

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (robertMacHale)

  • What a joke are Java and Android SDK. :-|

    You spent 5 minutes just to add an onclick handler?!

    In .NET you doubleclick the goddamn button and that's it, nothing to type, nothing to search by resource ID, just doubleclick!

    Switch to .NET step into a XXI century!

  • @TheMrColak :: Apples & Oranges...the UI Builder in Visual Studio 2010 is awesome. Are you judging the Android platform based on the Eclipse text editor and UI Builder? Keep looking deeper, there is a brighter future in the Android Mobile pathway than you may have noticed. (:o) RM

  • Check to see if the event binding for onClick is setup via OnClickListener. The LogCat is available through a standard import statement. Thanks. RM

  • The content of R.java is auto-generated. So, there is no need to place content here. When an image is imported, or a button added, then Eclipse takes care of this file. RM

see all

All Comments (17)

Sign In or Sign Up now to post a comment!
  • As a user of 10+ other languages, I'm not sure I like the way they did this.... But thanks for showing us how it works :)

  • I have to agree. MSVC did this same mechanism in 1991, i.e. lookup the control. This is a productivity drain.

  • @TheMrColak yeah that's a great idea. .net is on so many phones these days... ha!

  • Thanks for postng this tutorial! I have a comfortable understanding of Java and the drag and drop GUI builder for Eclipse is great ... only thing I couldn't grasp was how to bind a control / widget with Java methods / variables - This tute helps a great deal! Thanks once again :) U get my sub :)

  • I don't have any entries in my LogCat, you have others besides your "OnClick", do I have to enable logging somewhere?

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