I / Choreographer:跳过47帧!应用程序可能在其主线程上做了太多工作

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.main);

    buttonToDescription = (Button) findViewById(R.id.button2);

    Runnable r = () -> {
        MobileAds.initialize(this, APP_ID);
    };

    Thread t = new Thread(r);
    t.start();

    prepareAd();


    mInterstitialAd.setAdListener(new AdListener() {
        @Override
        public void onAdClosed() {
            if (isNextPressed) {
                startActivity(new Intent(Main.this, Description.class));
            } else{
                startActivity(new Intent(Main.this, Download.class));
            }
        }}
    );

准备广告是:

public void prepareAd() {
        mInterstitialAd = new InterstitialAd(this);
        mInterstitialAd.setAdUnitId(INTERSTITIAL_ID);
        mInterstitialAd.loadAd(new AdRequest.Builder().build());
    }

所以我不做任何计算/连接到db /任何耗时或主线程UI阻塞操作 . 为什么我可能会遇到这个问题?

回答(0)