简体   繁体   English

每次调用时都进行新的加载活动

[英]Fresh loading activity every time of calling it

In an android App im showing advertisement from a local advertisement company. 在一个android应用中,我正在显示来自本地广告公司的广告。

My problem is when start App and close it with back button, and back to it by clicking on its icon, i see the same Ad. 我的问题是,启动App并使用“后退”按钮将其关闭,然后通过单击其图标返回到它,我看到了相同的广告。 But when i close the app from android task manager and back to the app, i see another Ad. 但是,当我从android任务管理器中关闭该应用并返回该应用时,我看到了另一个广告。

I know this can have multiple reasons and my question is not clear, But my main questions that how i can set each activity runs like first time of running the app? 我知道这可能有多种原因,我的问题尚不清楚,但是我主要的问题是,如何设置每个活动就像第一次运行该应用程序一样? What should cause this reaction? 是什么引起该反应? its like a cookie system... i want every activity show new Ad! 它就像一个cookie系统...我希望每个活动都显示一个新的广告!

Here you can see example code: http://github.com/adad-project/client-app-sample 在这里,您可以看到示例代码: http : //github.com/adad-project/client-app-sample

Move 移动

Adad.initialize(getApplicationContext());
((AdView) findViewById(R.id.banner_ad_view)).setAdListener(mAdListener);

to onStart and remove from onCreate in MainActivity onStart并从MainActivity onCreate中删除

Do similar thing in other activities. 在其他活动中做类似的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM