Reputation: 894
I Wonder what is and does (this) in this code:
Button btn = new Button(this);
Upvotes: 0
Views: 279
Reputation: 137272
this
refers to the current object, which is probably the Activity
. Activity
extends Context
, and it is passed as Context
to the Button
constructor.
Upvotes: 5