androidandroid-anr-dialog

ANR Input dispatching timed out (Waiting because no window has focus but there is a focused application that may eventually)


A user of my app (Xperia Z1 Compact, Android 5.1) is experiencing a crash in my app when he is setting it up. Here's the workflow:

LaunchActivity is the Launch intent (noHistory=true, singleTask). It checks whether this is the app's first start or not. It is the first start, so it fires up BootActivity (noHistory=true, singleTask). BootActivity shows an animation of 3 seconds and opens up AddGoogleNewsActivity then (singleTask). This is the code that opens up AddGoogleNewsActivity:

in onCreate:

new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            endSplash();
        }
    }, 3000);


private void endSplash() {
    YoYo.with(Techniques.FadeOut)
            .duration(1000)
            .interpolate(new AccelerateDecelerateInterpolator())
            .withListener(new com.nineoldandroids.animation.Animator.AnimatorListener() {
                @Override
                public void onAnimationStart(com.nineoldandroids.animation.Animator animation) {

                }

                @Override
                public void onAnimationEnd(com.nineoldandroids.animation.Animator animation) {
                }

                @Override
                public void onAnimationCancel(com.nineoldandroids.animation.Animator animation) {

                }

                @Override
                public void onAnimationRepeat(com.nineoldandroids.animation.Animator animation) {

                }
            })
            .playOn(logo);
    YoYo.with(Techniques.FadeOut)
            .duration(1000)
            .interpolate(new AccelerateDecelerateInterpolator())
            .playOn(title2_txt);
    YoYo.with(Techniques.FadeOut)
            .duration(1000)
            .interpolate(new AccelerateDecelerateInterpolator())
            .playOn(title_txt);
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            if (intent.equals("start")) {
                startActivity(new Intent(BootActivity.this, AddGoogleNewsActivity.class));
            } else if (intent.equals("complete")) {
                Intent goToBoot = new Intent(BootActivity.this, HomeActivity.class);
                goToBoot.putExtra("intent", "setupdone");
                startActivity(goToBoot);
            }
        }
    }, 1000);
}

In AddGoogleNewsActivity, the app gets an ANR: ANR Input dispatching timed out (Waiting because no window has focus but there is a focused application that may eventually add a window when it finishes starting up.)

Does somebody know how I could fix this?

Many thanks!


Solution

  • EDIT from 30th May 2017: The REAL solution was that those devices did not have Text to Speech services available and that I needed to disable the access to it at all to stop those crashes.