Android IllegalStateException: Fragment not attached to Activity webview Android IllegalStateException: Fragment not attached to Activity webview android android

Android IllegalStateException: Fragment not attached to Activity webview


Generally you get that error when you try to perform work after the Fragment is no longer attached to the Activity. In the callback that triggers the IllegalStateException add a check for isAdded: http://developer.android.com/reference/android/app/Fragment.html#isAdded()

if(!isAdded()) {    return;}