I display into my android application AdMob's banners. I would like that when the user click on the banner it gone. I have try the code AdView.setOnClickListener
but it not work...
EDIT : this is the code
private void visual_banner(){
//##### Pubblicità #####
//Create the adView
adView = new AdView(this, AdSize.BANNER, "a14e5bed604ebf8");
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.layout_ads_streaming);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
adView.destroy();
img.setVisibility(View.VISIBLE);
}
});
adView.loadAd(new AdRequest());
//### FINE PUBBLICITA'
}