You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
When using @Background annotations on @EFragment there is all chances that the fragment may not be attached to the activity while calling @UiThread annotated method from a background thread. In the case of @EFragment it is required to do a getActivity()!=null check to avoid IllegalStateException as fragment not attached to Activity
Can this be done as a conditional check for @EFragments alone ?
I am not an AA developer, but i do not think this should be handled by the AA generated classes at all. There are very different scenarios and very different solutions for them, let the programmer resolve these. For example in a lot cases a simple null check is not enough if we really have to do this operation. By the way, the Android framework does not check this, too: if you are using an AsyncTask, it will also crash with IllegalStateException.
I totally agree with @WonderCsabo. I can't and we shouldn't handle this kind of use cases. If you really want to have a framework dealing with this you can take a look at the great RoboSpice project
When using
@Backgroundannotations on@EFragmentthere is all chances that the fragment may not be attached to the activity while calling@UiThreadannotated method from a background thread. In the case of@EFragmentit is required to do agetActivity()!=nullcheck to avoidIllegalStateException as fragment not attached to ActivityCan this be done as a conditional check for
@EFragmentsalone ?