diff options
author | 2011-01-20 10:59:28 -0800 | |
---|---|---|
committer | 2011-01-20 10:59:28 -0800 | |
commit | 482b34a6f8aebe620cf815cdc689726ef5cf437e (patch) | |
tree | 2650393655c0647c7ac0b94af489c05df7234ef7 | |
parent | ed8f8dd8cf621d6046db7e083f8a36205ed55609 (diff) |
Documentation fix.
Activity's documentation wasn't clear on what would happen when
calling setContentView(View).
Change-Id: I37be6565ba897694460c80a39562346293faa8ea
-rw-r--r-- | core/java/android/app/Activity.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index ec6eaaa8b577..2aef860a62b0 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -1762,8 +1762,11 @@ public class Activity extends ContextThemeWrapper /** * Set the activity content from a layout resource. The resource will be * inflated, adding all top-level views to the activity. - * + * * @param layoutResID Resource ID to be inflated. + * + * @see #setContentView(android.view.View) + * @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams) */ public void setContentView(int layoutResID) { getWindow().setContentView(layoutResID); @@ -1773,9 +1776,17 @@ public class Activity extends ContextThemeWrapper /** * Set the activity content to an explicit view. This view is placed * directly into the activity's view hierarchy. It can itself be a complex - * view hierarhcy. + * view hierarchy. When calling this method, the layout parameters of the + * specified view are ignored. Both the width and the height of the view are + * set by default to {@link ViewGroup.LayoutParams#MATCH_PARENT}. To use + * your own layout parameters, invoke + * {@link #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)} + * instead. * * @param view The desired content to display. + * + * @see #setContentView(int) + * @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams) */ public void setContentView(View view) { getWindow().setContentView(view); @@ -1785,10 +1796,13 @@ public class Activity extends ContextThemeWrapper /** * Set the activity content to an explicit view. This view is placed * directly into the activity's view hierarchy. It can itself be a complex - * view hierarhcy. + * view hierarchy. * * @param view The desired content to display. * @param params Layout parameters for the view. + * + * @see #setContentView(android.view.View) + * @see #setContentView(int) */ public void setContentView(View view, ViewGroup.LayoutParams params) { getWindow().setContentView(view, params); |