*> I know that the keyword "this" refers to an instance variable or can
invoke a constructor*
That is not what the keyword "this" references.  It references the instance
of the class you are currently in...

*> but I don't understand how passing "this" as the arg for
setOnClickListener () works?Could someone explain?*
Take a look at the argument list for setOnClickListener...  One of the
arguments is probably a View.  So, when you are calling setOnClickListener
and you are in a class that inherits View, you pass "this" because "this"
is-a View instance.  It wouldn't work if you were calling setOnClickListener
from a class that didn't eventually inherit from View.

Hope that helps... sounds to me like you may want to brush up a little bit
on Java.


----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Mon, Jul 12, 2010 at 8:50 PM, Keith Roberts <[email protected]> wrote:

> Hey all,
>
> I know that the keyword "this" refers to an instance variable or can
> invoke a constructor, but I don't understand how passing "this" as the
> arg for setOnClickListener () works?Could someone explain?
>
>
> Thanks,
>
> keith
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> [email protected]<android-beginners%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to