forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
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 is sponsored by eBusinessInformations.
09/11/2014 The 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