Skip to content

Commit

Permalink
Update BiddingSplashActivity.java
Browse files Browse the repository at this point in the history
updata bidding splash
  • Loading branch information
little-cute233 authored Jul 22, 2024
1 parent 2ad73c7 commit 2c34f38
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void onAdFailed(int errorCode) {

private void showSplashAd() {
Log.i(TAG, "showSplashAd");
SplashView splashView = splashAd.getSplashView();
SplashView splashView = getSplashView();
splashContainer.removeAllViews();
RelativeLayout.LayoutParams splashParam = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
splashContainer.addView(splashView, splashParam);
Expand All @@ -124,6 +124,25 @@ private void showSplashAd() {
}
}

private SplashView getSplashView() {
SplashView splashView = splashAd.getSplashView();
BiddingSplashActivity BiddingSplashActivity = new BiddingSplashActivity();
splashView.setAdDisplayListener(new SplashAdDisplayListener(){
private WeakReference<BiddingSplashActivity> activityRef = new WeakReference<>(BiddingSplashActivity);
@Override
public void onAdClick() {
BiddingSplashActivity splashActivity = activityRef.get();
if (null == splashActivity) {
return;
}
super.onAdClick();
Log.d(TAG, "onAdClick");
Toast.makeText(splashActivity.getApplicationContext(), "onAdClick", Toast.LENGTH_LONG).show();
}
});
return splashView;
}

@Override
// 从其他页面回到开屏页面时调用,进入应用
protected void onRestart() {
Expand Down

0 comments on commit 2c34f38

Please sign in to comment.