如果他们被点击一次,我希望删除广告。我实现了以下代码。我还在android:launchMode="singleInstance"
清单和清单android:alwaysRetainTaskState="true"
的活动部分中添加了。
但是当我点击广告并返回应用程序时,广告仍在显示。我的代码如下。
public class MainActivity extends Activity implements AdListener{
adView = (AdView)findViewById(R.id.ad);
adView.loadAd(new AdRequest());
// my code
@Override
public void onDismissScreen(Ad arg0) {
if (adView != null) {
adView.destroy();
}
// TODO Auto-generated method stub
}
@Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
// TODO Auto-generated method stub
}
@Override
public void onLeaveApplication(Ad arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPresentScreen(Ad arg0) {
// TODO Auto-generated method stub
}
@Override
public void onReceiveAd(Ad arg0) {
// TODO Auto-generated method stub
}
}