4

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!

Made by FA
  • 710
  • 2
  • 7
  • 27

3 Answers3

1

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.

Made by FA
  • 710
  • 2
  • 7
  • 27
  • I am seeing this issue on Amazon Fire TV, which is based on Android 5.1. I was skeptical that this would be a fix, but I tried it anyways. This did not fix my issue. – bkant Dec 21 '16 at 04:17
  • @Florent Anders could you provide more info and maybe some code for your edit? – snachmsm Jun 26 '17 at 10:17
  • @snachmsm I just removed all TTS features from my app and all TTS code too. Haven't added it back since today and I guess I won't do it anymore. – Made by FA Jul 01 '17 at 15:04
0

I have the same problem and it's only happen in some time,not all the time.

I think if Activity A jump to Activity B in oncreate method,it will maybe happen.But I have no proof.

XW L
  • 11
  • 2
0

I encountered the same problem. I increased the delay time from 1000 millis to 2000millis to start new activity. After that, this ANR was disappeared.