I'm study an article, and found out "this" is used. Below is a quick summary of the codes:
public class CustomAd implements CustomEventBanner, AdListener {
private CustomEventBannerListener bannerListener;
private AdView adView;
@Override
public void requestBannerAd(final CustomEventBannerListener listener,
final Activity activity,
String label,
String serverParameter,
AdSize adSize,
MediationAdRequest mediationAdRequest,
Object extra) {
this.bannerListener = listener;
this.adView = new AdView(activity, bestAdSize, serverParameter);
this.adView.setAdListener(this);
AdRequest adRequest = new AdRequest();
this.adView.loadAd(adRequest);
}
}
Here, we can see that the field "adView" is created under the class "CustomAd". In order to reference it, we've used "this.adView". However, I found that even I don't use "this" (so it will be "adView" instead of "this.adView"), everything goes fine without any error.
So what is the purpose of using "this" here?
Thanks.