1. Download our Official Android App: Forums for Android!

Why setOnClickListener?

Discussion in 'Android Apps & Games' started by pavanaradhya, Jan 10, 2012.

  1. pavanaradhya

    pavanaradhya Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jan 10, 2012

    Jan 10, 2012
    1
    0
    5
    Hi,

    To handle click event for button we use
    setOnClickListener

    Why we use this? I am really confused.

    Can anyone explain me.

    Thanks,
    Pavan
     

    Advertisement

  2. Lemoncog

    Lemoncog Newbie
    Rank:
    None
    Points:
    36
    Posts:
    26
    Joined:
    Feb 23, 2011

    A listener is an Object Orientated Principle that will allow your class to react to something done by another class without having to actively monitor it.
     

Share This Page

Loading...