【发布时间】:2020-11-20 18:46:23
【问题描述】:
我的活动中有一个横幅广告。 我在 mainActivity.java 中有 4 个 @Overridable 方法 的横幅广告。
我想要什么?
- 我要声明一个方法
- 我想把这 4 个事件放到我的方法中
一句话:
我可以在方法中加入@Overrides 吗?
private void allTogether(){
@Override
public void onAdFailedToLoad(int errorCode) {
// Code to be executed when an ad request fails.
}
@Override
public void onAdOpened() {
// Code to be executed when an ad opens an overlay that
// covers the screen.
}
@Override
public void onAdClicked() {
// Code to be executed when the user clicks on an ad.
}
@Override
public void onAdLeftApplication() {
// Code to be executed when the user has left the app.
}
@Override
public void onAdClosed() {
// Code to be executed when the user is about to return
// to the app after tapping on an ad.
}
我该怎么做?
【问题讨论】:
标签: java android-studio events android-activity methods