| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Since AndroidAnnotations 3.1 until AndroidAnnotations 3.3.2
When used standalone in an @EFragment or in conjunction with the @UiThread or @Background annotations, the annotated method will be wrapped in an 'if attached' block such that no code will be executed if the @EFragment is no longer bound to its parent activity.
Should be used on method that must meet the following criteria:
Usage example:
@EFragment
public class LoaderFragment extends Fragment {
[...]
@UiThread
@IgnoredWhenDetached
void killActivity() {
getActivity().finish();
}
@IgnoredWhenDetached
void updateTitle(String title) {
getActivity().setTitle(title);
}
}Since AndroidAnnotations 4.0.0
When used standalone in an @EFragment or in conjunction with the @UiThread or @Background annotations, the annotated method will be wrapped in an 'if attached' block such that no code will be executed if the @EFragment is no longer bound to its parent activity or the @EFragment views are destroyed
Should be used on method that must meet the following criteria:
Usage example:
@EFragment
public class LoaderFragment extends Fragment {
[...]
@UiThread
@IgnoreWhen(IgnoreWhen.State.DETACHED)
void killActivity() {
getActivity().finish();
}
@IgnoreWhen(IgnoreWhen.State.VIEW_DESTROYED)
void setViewBackground(int resid) {
view.setBackgroundResource(resid);
}
}Since AndroidAnnotations 4.0.0
AndroidAnnotations currently support two states for ignoring execution:
| Back | FazBrowse Home | New Git URL |