Android app crashes when switching Fragment after showing a keyboard that is set with nextFocusDown

折月煮酒 提交于 2019-12-05 01:58:58

The thing that solved the issue for me was:

  1. Clean the build (Build->Clean Project)
  2. Exit Android Studio
  3. Restart the android device
  4. Start Android Studio (AFTER DEVICE STARTED)
  5. Run

I have no idea why it solved the issue for me (I mostly write apps for iOS, and I never experienced bugs that require a device restart...). The weird thing is that I restarted the device, Android Studio, and clean the projects many times - so it appears the whole process has to be in that order...

Bartosz

I faced with that bug today as well. I´m not sure if it will help in your case but it helped me. Based on answers in this topic: Android Studio 3.1 EditText StackOverflowError.

In my case it was enough just to disable advanced profiling

Run --> Edit Configuration --> Profiling Tab

In my case bug happen after changing conductor Controller from one with inputs to another. Error was exactly the same. And same as in related link i updated AS to 3.1.1 today.

I had the same error using the Navigation from Android Architeture Components, which uses Fragment Transaction inside. The issue was that the EditText had text before the transaction and for some reason Android framework crashed.

The solution was setting all the EditText to null before doing the transaction.

For zero reason, the above solutions didn't work. For zero reason, starting an emulator alongside my device and launching the app on both at once fixed the issue.

This doesn't make any sense and whoever did this crap owes me an hour.

I hope I can save someone's time if this fixes the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!