gpt4 book ai didi

当有人点击广告后返回时,Android 应用程序不会恢复

转载 作者:行者123 更新时间:2023-11-29 21:46:29 25 4
gpt4 key购买 nike

当有人点击广告并返回应用时,应用不会恢复。我在 mainfest 中添加了 android:launchMode="singleInstance" 并在 list 的 Activity 声明中添加了 android:alwaysRetainTaskState="true"

我不知道哪里出错了。

我的 .java 文件代码如下:

 public class MainActivity extends Activity implements AdListener{

public static int count=0,dispad=0;
public static LinearLayout lay1;
private static final Class<?>[] NUMBERS = {First.class};
protected AdView adView;
View admobAds;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
adView = (AdView)findViewById(R.id.ad);

Toast toast = Toast.makeText(getApplicationContext(), "Click on the ad to
make it disappear" +
"", Toast.LENGTH_LONG);
toast.show();

adView.loadAd(new AdRequest());

lay1=(LinearLayout)this.findViewById(R.id.mainlay);

admobAds = (View) findViewById(R.id.ad);

//More code

public void onDismissScreen(Ad arg0) {

lay1.removeView(admobAds);
dispad=1;
// TODO Auto-generated method stub

}
}

最佳答案

关于当有人点击广告后返回时,Android 应用程序不会恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15674317/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com