Clicking on an ad opens a browser, but I cannot go back to the launching activity screen of my Android app












0















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.










share|improve this question




















  • 1





    Please post your activity code so we can see if there are any issues.

    – Sub 6 Resources
    Nov 22 '18 at 5:13











  • there is some problem with your code for sure.

    – Vladyslav Matviienko
    Nov 22 '18 at 6:24
















0















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.










share|improve this question




















  • 1





    Please post your activity code so we can see if there are any issues.

    – Sub 6 Resources
    Nov 22 '18 at 5:13











  • there is some problem with your code for sure.

    – Vladyslav Matviienko
    Nov 22 '18 at 6:24














0












0








0








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.










share|improve this question
















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.







android ads banner-ads appodeal






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 11:15







Carlos Botero

















asked Nov 22 '18 at 5:09









Carlos BoteroCarlos Botero

6428




6428








  • 1





    Please post your activity code so we can see if there are any issues.

    – Sub 6 Resources
    Nov 22 '18 at 5:13











  • there is some problem with your code for sure.

    – Vladyslav Matviienko
    Nov 22 '18 at 6:24














  • 1





    Please post your activity code so we can see if there are any issues.

    – Sub 6 Resources
    Nov 22 '18 at 5:13











  • there is some problem with your code for sure.

    – Vladyslav Matviienko
    Nov 22 '18 at 6:24








1




1





Please post your activity code so we can see if there are any issues.

– Sub 6 Resources
Nov 22 '18 at 5:13





Please post your activity code so we can see if there are any issues.

– Sub 6 Resources
Nov 22 '18 at 5:13













there is some problem with your code for sure.

– Vladyslav Matviienko
Nov 22 '18 at 6:24





there is some problem with your code for sure.

– Vladyslav Matviienko
Nov 22 '18 at 6:24












1 Answer
1






active

oldest

votes


















0














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







share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424234%2fclicking-on-an-ad-opens-a-browser-but-i-cannot-go-back-to-the-launching-activit%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    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







    share|improve this answer




























      0














      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







      share|improve this answer


























        0












        0








        0







        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







        share|improve this answer













        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








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        Carlos BoteroCarlos Botero

        6428




        6428






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424234%2fclicking-on-an-ad-opens-a-browser-but-i-cannot-go-back-to-the-launching-activit%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            TypeError: fit_transform() missing 1 required positional argument: 'X'