I'm currently displaying a banner-ad in my applications PlayScreen with the Appodeal SDK. The onCreate() method looks like this
@Override
protected void onCreate (Bundle savedInstanceState) {
...
View gameView = initializeForView(new MyGame(this, this, this), config);
GdxAppodeal.getInstance().disableLocationPermissionCheck();
GdxAppodeal.getInstance().initialize("myappkey", GdxAppodeal.BANNER);
GdxAppodeal.getInstance().setTesting(true);
GdxAppodeal.getInstance().setLogging(true);
layout.addView(gameView);
setContentView(layout);
}
The onResume() looks like this
@Override
protected void onResume(){
super.onResume();
Appodeal.onResume(this, Appodeal.BANNER);
}
And the banner is displayed through
GdxAppodeal.getInstance().show(GdxAppodeal.BANNER_BOTTOM);
Problem:
On app start, the banner is displayed correctly in the PlayScreen and hiden in the MenuScreen. But when i exit the app with Gdx.app.exit or press the home button and restart it, no banner is shown in the PlayScreen. Appodeal logs the same lines in both cases
[..] D/Appodeal: Showing Banner (debugType: banner_320, isLoaded: true, isLoading: false)
[..] D/Appodeal: Mraid onBannerShown
My best guess is, that it has to do with the GdxAppodeal.getInstance() (Singletone) not being recreated when the application is still active in the background. Everytime this instance is freshly created, the banner shows.