I have looked at a lot of android tutorials over the internet. In these tutorials they use the this context for the context everywhere. I know what this keyword means in Java, but I can’t make equal this, with the this keyword in Android programming. For example, at AlertDialog.Builder, on the developer.android.com site, there is only one reference at the parameters to the Context, but I can’t learn what this this means here.
I have looked at a lot of android tutorials over the internet. In these
Share
if you have an Activity you can use
thisbecause:thisis the current instance of a classso you can use your current Activity as a Context.
Look here for the Acitivty doc
and here for an explanation of
this