Waiting because no window has focus but there is a "focused application that may eventually add a window when...












4















Please help me to understand what is meaning of below ANR?
"Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."










share|improve this question























  • Can you give us some context of what you were doing at the time? My guess would be that you have the UI thread pausing too long and tripping a watchdog, but that's a pure guess.

    – Gabe Sechan
    Jun 25 '15 at 21:42











  • I have an background transparent activity (No UI), which will launch while device receive incoming phone call intent (android.intent.action.PHONE_STATE). Issues is when I press volume key continuously it throw ANR . I am not overriding onkeyEvent and dispatchKeyEvent.

    – Ashish
    Jun 25 '15 at 22:15











  • Sounds like ANdroid is trying to dispatch the key, and it sees that your app has the priority, but that you don't have a UI to dispatch it to. And then its waiting for you to put a UI up. Since you don't, it can't process the key and ends up ANRing your app. WHy do you have a transparent UI- if you don't have any UI elements you should be in a service or BroadcastReceiver.

    – Gabe Sechan
    Jun 25 '15 at 22:18











  • Yeh, I have used service for that and there is no ANR . But I have some design issue and it is already implemented code running in production. I just want to know is there any solution to avoid ANR with activity without UI component.

    – Ashish
    Jun 26 '15 at 2:46
















4















Please help me to understand what is meaning of below ANR?
"Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."










share|improve this question























  • Can you give us some context of what you were doing at the time? My guess would be that you have the UI thread pausing too long and tripping a watchdog, but that's a pure guess.

    – Gabe Sechan
    Jun 25 '15 at 21:42











  • I have an background transparent activity (No UI), which will launch while device receive incoming phone call intent (android.intent.action.PHONE_STATE). Issues is when I press volume key continuously it throw ANR . I am not overriding onkeyEvent and dispatchKeyEvent.

    – Ashish
    Jun 25 '15 at 22:15











  • Sounds like ANdroid is trying to dispatch the key, and it sees that your app has the priority, but that you don't have a UI to dispatch it to. And then its waiting for you to put a UI up. Since you don't, it can't process the key and ends up ANRing your app. WHy do you have a transparent UI- if you don't have any UI elements you should be in a service or BroadcastReceiver.

    – Gabe Sechan
    Jun 25 '15 at 22:18











  • Yeh, I have used service for that and there is no ANR . But I have some design issue and it is already implemented code running in production. I just want to know is there any solution to avoid ANR with activity without UI component.

    – Ashish
    Jun 26 '15 at 2:46














4












4








4


4






Please help me to understand what is meaning of below ANR?
"Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."










share|improve this question














Please help me to understand what is meaning of below ANR?
"Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."







android






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 25 '15 at 21:26









AshishAshish

2515




2515













  • Can you give us some context of what you were doing at the time? My guess would be that you have the UI thread pausing too long and tripping a watchdog, but that's a pure guess.

    – Gabe Sechan
    Jun 25 '15 at 21:42











  • I have an background transparent activity (No UI), which will launch while device receive incoming phone call intent (android.intent.action.PHONE_STATE). Issues is when I press volume key continuously it throw ANR . I am not overriding onkeyEvent and dispatchKeyEvent.

    – Ashish
    Jun 25 '15 at 22:15











  • Sounds like ANdroid is trying to dispatch the key, and it sees that your app has the priority, but that you don't have a UI to dispatch it to. And then its waiting for you to put a UI up. Since you don't, it can't process the key and ends up ANRing your app. WHy do you have a transparent UI- if you don't have any UI elements you should be in a service or BroadcastReceiver.

    – Gabe Sechan
    Jun 25 '15 at 22:18











  • Yeh, I have used service for that and there is no ANR . But I have some design issue and it is already implemented code running in production. I just want to know is there any solution to avoid ANR with activity without UI component.

    – Ashish
    Jun 26 '15 at 2:46



















  • Can you give us some context of what you were doing at the time? My guess would be that you have the UI thread pausing too long and tripping a watchdog, but that's a pure guess.

    – Gabe Sechan
    Jun 25 '15 at 21:42











  • I have an background transparent activity (No UI), which will launch while device receive incoming phone call intent (android.intent.action.PHONE_STATE). Issues is when I press volume key continuously it throw ANR . I am not overriding onkeyEvent and dispatchKeyEvent.

    – Ashish
    Jun 25 '15 at 22:15











  • Sounds like ANdroid is trying to dispatch the key, and it sees that your app has the priority, but that you don't have a UI to dispatch it to. And then its waiting for you to put a UI up. Since you don't, it can't process the key and ends up ANRing your app. WHy do you have a transparent UI- if you don't have any UI elements you should be in a service or BroadcastReceiver.

    – Gabe Sechan
    Jun 25 '15 at 22:18











  • Yeh, I have used service for that and there is no ANR . But I have some design issue and it is already implemented code running in production. I just want to know is there any solution to avoid ANR with activity without UI component.

    – Ashish
    Jun 26 '15 at 2:46

















Can you give us some context of what you were doing at the time? My guess would be that you have the UI thread pausing too long and tripping a watchdog, but that's a pure guess.

– Gabe Sechan
Jun 25 '15 at 21:42





Can you give us some context of what you were doing at the time? My guess would be that you have the UI thread pausing too long and tripping a watchdog, but that's a pure guess.

– Gabe Sechan
Jun 25 '15 at 21:42













I have an background transparent activity (No UI), which will launch while device receive incoming phone call intent (android.intent.action.PHONE_STATE). Issues is when I press volume key continuously it throw ANR . I am not overriding onkeyEvent and dispatchKeyEvent.

– Ashish
Jun 25 '15 at 22:15





I have an background transparent activity (No UI), which will launch while device receive incoming phone call intent (android.intent.action.PHONE_STATE). Issues is when I press volume key continuously it throw ANR . I am not overriding onkeyEvent and dispatchKeyEvent.

– Ashish
Jun 25 '15 at 22:15













Sounds like ANdroid is trying to dispatch the key, and it sees that your app has the priority, but that you don't have a UI to dispatch it to. And then its waiting for you to put a UI up. Since you don't, it can't process the key and ends up ANRing your app. WHy do you have a transparent UI- if you don't have any UI elements you should be in a service or BroadcastReceiver.

– Gabe Sechan
Jun 25 '15 at 22:18





Sounds like ANdroid is trying to dispatch the key, and it sees that your app has the priority, but that you don't have a UI to dispatch it to. And then its waiting for you to put a UI up. Since you don't, it can't process the key and ends up ANRing your app. WHy do you have a transparent UI- if you don't have any UI elements you should be in a service or BroadcastReceiver.

– Gabe Sechan
Jun 25 '15 at 22:18













Yeh, I have used service for that and there is no ANR . But I have some design issue and it is already implemented code running in production. I just want to know is there any solution to avoid ANR with activity without UI component.

– Ashish
Jun 26 '15 at 2:46





Yeh, I have used service for that and there is no ANR . But I have some design issue and it is already implemented code running in production. I just want to know is there any solution to avoid ANR with activity without UI component.

– Ashish
Jun 26 '15 at 2:46












2 Answers
2






active

oldest

votes


















0














Well, I am facing the same issue and this is what I come up with.



The log you mentioned:
"Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."



is dispatched by the InputDispatcher.cpp from AOSP framework.



It happens when InputDispatcher is waiting for application to add a window to inject input. If the time waiting > 5000ms, then you will have an ANR.






share|improve this answer
























  • You got solution to this issue? @banana-droid

    – Shanmugapriyan
    Feb 2 '18 at 8:02













  • @Shanmugapriyan, it depends on different cases. For me, it was one of my apps are memory leaked. I meant this issue is not specifically point out the problem underneath.

    – Banana droid
    Feb 6 '18 at 3:00





















0














I think this happens when an activity is started but somehow it doesn't add any content view to interact with user. I also saw this error on developer console because there was an issue with app's framework and it used to get stuck on splash screen. The reason was the activity doesn't call setContentView by default but waits for the app framework to initialize, and when framework initialized completely it didn't add any view to activity because of a bug.






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%2f31061076%2fwaiting-because-no-window-has-focus-but-there-is-a-focused-application-that-may%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Well, I am facing the same issue and this is what I come up with.



    The log you mentioned:
    "Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."



    is dispatched by the InputDispatcher.cpp from AOSP framework.



    It happens when InputDispatcher is waiting for application to add a window to inject input. If the time waiting > 5000ms, then you will have an ANR.






    share|improve this answer
























    • You got solution to this issue? @banana-droid

      – Shanmugapriyan
      Feb 2 '18 at 8:02













    • @Shanmugapriyan, it depends on different cases. For me, it was one of my apps are memory leaked. I meant this issue is not specifically point out the problem underneath.

      – Banana droid
      Feb 6 '18 at 3:00


















    0














    Well, I am facing the same issue and this is what I come up with.



    The log you mentioned:
    "Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."



    is dispatched by the InputDispatcher.cpp from AOSP framework.



    It happens when InputDispatcher is waiting for application to add a window to inject input. If the time waiting > 5000ms, then you will have an ANR.






    share|improve this answer
























    • You got solution to this issue? @banana-droid

      – Shanmugapriyan
      Feb 2 '18 at 8:02













    • @Shanmugapriyan, it depends on different cases. For me, it was one of my apps are memory leaked. I meant this issue is not specifically point out the problem underneath.

      – Banana droid
      Feb 6 '18 at 3:00
















    0












    0








    0







    Well, I am facing the same issue and this is what I come up with.



    The log you mentioned:
    "Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."



    is dispatched by the InputDispatcher.cpp from AOSP framework.



    It happens when InputDispatcher is waiting for application to add a window to inject input. If the time waiting > 5000ms, then you will have an ANR.






    share|improve this answer













    Well, I am facing the same issue and this is what I come up with.



    The log you mentioned:
    "Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."



    is dispatched by the InputDispatcher.cpp from AOSP framework.



    It happens when InputDispatcher is waiting for application to add a window to inject input. If the time waiting > 5000ms, then you will have an ANR.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 13 '17 at 4:40









    Banana droidBanana droid

    740719




    740719













    • You got solution to this issue? @banana-droid

      – Shanmugapriyan
      Feb 2 '18 at 8:02













    • @Shanmugapriyan, it depends on different cases. For me, it was one of my apps are memory leaked. I meant this issue is not specifically point out the problem underneath.

      – Banana droid
      Feb 6 '18 at 3:00





















    • You got solution to this issue? @banana-droid

      – Shanmugapriyan
      Feb 2 '18 at 8:02













    • @Shanmugapriyan, it depends on different cases. For me, it was one of my apps are memory leaked. I meant this issue is not specifically point out the problem underneath.

      – Banana droid
      Feb 6 '18 at 3:00



















    You got solution to this issue? @banana-droid

    – Shanmugapriyan
    Feb 2 '18 at 8:02







    You got solution to this issue? @banana-droid

    – Shanmugapriyan
    Feb 2 '18 at 8:02















    @Shanmugapriyan, it depends on different cases. For me, it was one of my apps are memory leaked. I meant this issue is not specifically point out the problem underneath.

    – Banana droid
    Feb 6 '18 at 3:00







    @Shanmugapriyan, it depends on different cases. For me, it was one of my apps are memory leaked. I meant this issue is not specifically point out the problem underneath.

    – Banana droid
    Feb 6 '18 at 3:00















    0














    I think this happens when an activity is started but somehow it doesn't add any content view to interact with user. I also saw this error on developer console because there was an issue with app's framework and it used to get stuck on splash screen. The reason was the activity doesn't call setContentView by default but waits for the app framework to initialize, and when framework initialized completely it didn't add any view to activity because of a bug.






    share|improve this answer




























      0














      I think this happens when an activity is started but somehow it doesn't add any content view to interact with user. I also saw this error on developer console because there was an issue with app's framework and it used to get stuck on splash screen. The reason was the activity doesn't call setContentView by default but waits for the app framework to initialize, and when framework initialized completely it didn't add any view to activity because of a bug.






      share|improve this answer


























        0












        0








        0







        I think this happens when an activity is started but somehow it doesn't add any content view to interact with user. I also saw this error on developer console because there was an issue with app's framework and it used to get stuck on splash screen. The reason was the activity doesn't call setContentView by default but waits for the app framework to initialize, and when framework initialized completely it didn't add any view to activity because of a bug.






        share|improve this answer













        I think this happens when an activity is started but somehow it doesn't add any content view to interact with user. I also saw this error on developer console because there was an issue with app's framework and it used to get stuck on splash screen. The reason was the activity doesn't call setContentView by default but waits for the app framework to initialize, and when framework initialized completely it didn't add any view to activity because of a bug.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 17 '18 at 13:47









        Serdar SamancıoğluSerdar Samancıoğlu

        638415




        638415






























            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%2f31061076%2fwaiting-because-no-window-has-focus-but-there-is-a-focused-application-that-may%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







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini