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 4de3cab commit 2ad73c7
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public class BiddingSplashActivity extends BaseActivity {

private SplashAd splashAd;

// 返回键标志位 按返回键退出时应用不被重新拉起,但是在展示广告时下拉通知栏仍然需要正常跳转
private boolean hasPaused = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
// set full screen
Expand Down Expand Up @@ -122,16 +125,18 @@ private void showSplashAd() {
}

@Override
// 从其他页面回到开屏页面时调用,进入应用
protected void onRestart() {
// 从其他页面回到开屏页面时调用,进入应用
Log.d(TAG, "onRestart");
super.onRestart();
Log.d(TAG, "onRestart");
hasPaused = false;
jump();
}

@Override
protected void onStop() {
Log.d(TAG, "onStop");
hasPaused = true;
super.onStop();
}

Expand Down Expand Up @@ -198,8 +203,13 @@ private int getScreenOrientation() {
}

private void jump() {
startActivity(new Intent(BiddingSplashActivity.this, MainActivity.class));
finish();
Log.d(TAG, "jump hasPaused: " + hasPaused);
if(!hasPaused) {
hasPaused = true;
Log.d(TAG, "jump into application");
startActivity(new Intent(BiddingSplashActivity.this, MainActivity.class));
finish();
}
}

private void showMsg(String msg) {
Expand Down

0 comments on commit 2ad73c7

Please sign in to comment.