@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());
}
因此,我不进行任何计算/与数据库的连接/任何耗时的操作或主线程UI阻塞操作。为什么我可能会有这个问题?