Skip to content Skip to sidebar Skip to footer

Runtimeexception In One Case. Nullexeption - Getbackstackcount()

Only when my app was off (freed resourses for other apps) and when i again opened it, i got this exaption. If i myself closed app, all it worked. 11-10 22:00:10.007 6255-6255/com.j

Solution 1:

Try to use this:

@Override
public void resetToolbarNavigation(boolean backNavigationEnabled) {
    setSupportActionBar(mToolbar);

    getSupportActionBar().setDisplayHomeAsUpEnabled(backNavigationEnabled);
    if (backNavigationEnabled) {
        mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // Log.i("resetToolbarNavigation", "setNavigationOnClickListener");
                onBackPressed();
            }
        });
    }
    else {
        initNavigation();
        syncState();
    }
}

Post a Comment for "Runtimeexception In One Case. Nullexeption - Getbackstackcount()"