Skip to content Skip to sidebar Skip to footer

Clicking On An Ad Opens A Browser, But I Cannot Go Back To The Launching Activity Screen Of My Android App

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 th

Solution 1:

Solved! I implemented the advice by the User: AngraX from this page:

How can I do that in Android. Activity -> WebBrowser -> Acrivity, but Press Back not see the WebBrowser

where he recommends to add this to the Main Activity declaration in the Manifest file of your App:

  android:allowTaskReparenting="true"
  android:launchMode="singleTask"

And it works! After the Smaato ad in my App launches a tab in the default web browser of the device, I am now able to return to my Main Activity, no matter if the returning is done in any of these 3 ways:

  1. By pressing back button the necessary number of times to return to the Main Activity screen, no matter if you press back button from your App or from the browser

  2. By clicking the close (X) button on the screen of your App

  3. By pressing the square button of your Android device (Menu Button), and then choosing your App


Post a Comment for "Clicking On An Ad Opens A Browser, But I Cannot Go Back To The Launching Activity Screen Of My Android App"