Repository navigation
IgnoredWhenDetached
Csaba Kozák edited this page Sep 1, 2014
·
1 revision
Since AndroidAnnotations 3.1
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:
- Can only be used in conjunction with classes annotated with @EFragment
- The annotated method must return void and may contain parameters.
Usage example:
@EFragment
public class LoaderFragment extends Fragment {
[...]
@UiThread
@IgnoredWhenDetached
void killActivity() {
getActivity().finish();
}
@IgnoredWhenDetached
void updateTitle(String title) {
getActivity().setTitle(title);
}
}AndroidAnnotations was created by Pierre-Yves Ricau and was originally sponsored by eBusinessInformations.
10/07/2015 The 3.3.2 release is out !
- Get started!
- Download
- Cookbook, full of recipes
- Customize annotation processing
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow
- Ask on Gitter