Even though there is a similar case here:
After click AdMob ads, I cannot return to my Android app by back button
the code proposed didn't solve my case. So I am posting this if there's somebody with fresh ideas to solve this.
I have coded an app for Android. Now I am trying to add ads to this app. I am implementing the ads from Appodeal. When I show an ad type called MREC (which is a square-like banner) on my main activity, if I click on the ad, it will open a tab in the default browser of the device.
The problem arises when I press the square button on the device (the menu that displays the current running apps): it displays the browser and also my own app as active. If I select my app, Android wont let my app come to the forefront, instead it shows the device background or the recently opened browser. It's like the browser has taken over the "identity" of my app.
So, why I cannot return to the activity screen where the ad is located, and from where the click launched a browser tab?
One more thing is that in the sample apps that Appodeal provide, there is no code in onResume, and there isn't any different code from the Appodeal SDK in the manifest, and yet, the app returns correctly to the main activity after coming from the browser tab. I am also trying to implement Admob ads, and the same effect happens as described in this post.