CoordinatorLayout crashes app with IndexOutOfBoundsException

百般思念 提交于 2019-11-30 09:44:29
Bram Sinke

I had a similar issue, and downgrading to a older Android Support Library version(v24.1.1) worked for me. It's seems to be a problem in the Library, you can check the problem out the Android Issue Tracker here.

UPDATE 1 : Seems like it's going to be resolved in de next version of the Android Support Library(v24.2.1), thanks Daniel Rampelt for the update

UPDATE 2 : 24.2.1 is out as of today and the error seems to be resolved—at least I couldnae reproduce it with the current version. – PattaFeuFeu

UPDATE 3 : 24.2.1 introduced new bug: post – AAverin

Even i had the same issue

my issue was because of showing snackbar i enclosed showing snackbar code with try catch now its workng fine

 /**
 * try catch becuase of SupportLibrary bug link "https://code.google.com/p/android/issues/detail?id=220762"
 *
 * @param v
 */
public void showConnectionErr(View v) {
    try {
        Snackbar b = getFailureSnackBar(v, "Bluetooth connection lost", false);
        b.setAction("RETRY", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                new ConnectThread().execute();
            }
        });
        b.show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!