diff options
author | Scott Main <smain@google.com> | 2012-03-09 19:10:40 -0800 |
---|---|---|
committer | Scott Main <smain@google.com> | 2012-07-25 13:52:46 -0700 |
commit | bbb3f41e26ac5a996913907dc63786146132b4ce (patch) | |
tree | 44c3c366cedcebb8702501b6b094672db684153c /docs/html/guide/components | |
parent | 156671ef9a6581b6790bb17bfda8a9efcf9f0693 (diff) | |
download | frameworks_base-bbb3f41e26ac5a996913907dc63786146132b4ce.zip frameworks_base-bbb3f41e26ac5a996913907dc63786146132b4ce.tar.gz frameworks_base-bbb3f41e26ac5a996913907dc63786146132b4ce.tar.bz2 |
docs: add Settings dev guide;
a few changes to javadocs
Change-Id: I2d671aafe91e4c6e224e2a556a60dce9f93f11ae
Diffstat (limited to 'docs/html/guide/components')
-rw-r--r-- | docs/html/guide/components/fragments.jd | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/html/guide/components/fragments.jd b/docs/html/guide/components/fragments.jd index 938e0ab..4f62033 100644 --- a/docs/html/guide/components/fragments.jd +++ b/docs/html/guide/components/fragments.jd @@ -709,6 +709,12 @@ href="{@docRoot}guide/components/activities.html#Lifecycle">managing the activit lifecycle</a> also apply to fragments. What you also need to understand, though, is how the life of the activity affects the life of the fragment.</p> +<p class="caution"><strong>Caution:</strong> If you need a {@link android.content.Context} object +within your {@link android.app.Fragment}, you can call {@link android.app.Fragment#getActivity()}. +However, be careful to call {@link android.app.Fragment#getActivity()} only when the fragment is +attached to an activity. When the fragment is not yet attached, or was detached during the end of +its lifecycle, {@link android.app.Fragment#getActivity()} will return null.</p> + <h3 id="CoordinatingWithActivity">Coordinating with the activity lifecycle</h3> |