From 96ab46039d561213edda37cc2d63dd452bd80fc7 Mon Sep 17 00:00:00 2001 From: Katie McCormick Date: Mon, 27 Aug 2012 15:43:21 -0700 Subject: [PATCH] Doc update: Appwidgets JB additions. Change-Id: Id18a1c82a50fc654e383d9acb53ca61073172287 --- docs/html/guide/topics/appwidgets/index.jd | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd index a46f9a76f6ee5..5a4e03ac8db37 100644 --- a/docs/html/guide/topics/appwidgets/index.jd +++ b/docs/html/guide/topics/appwidgets/index.jd @@ -307,6 +307,7 @@ following layout classes:

  • {@link android.widget.FrameLayout}
  • {@link android.widget.LinearLayout}
  • {@link android.widget.RelativeLayout}
  • +
  • {@link android.widget.GridLayout}
  • And the following widget classes:

    @@ -327,6 +328,9 @@ following layout classes:

    Descendants of these classes are not supported.

    +

    RemoteViews also supports {@link android.view.ViewStub}, which is an invisible, zero-sized View you can use +to lazily inflate layout resources at runtime.

    +

    Adding margins to App Widgets

    @@ -410,6 +414,25 @@ App Widget, done. (See Creating an App Widget Configuration Activity below.) + +
    + {@link android.appwidget.AppWidgetProvider#onAppWidgetOptionsChanged onAppWidgetOptionsChanged()} +
    +
    +This is called when the widget is first placed and any time the widget is resized. You can use this callback to show or hide content based on the widget's size ranges. You get the size ranges by calling {@link android.appwidget.AppWidgetManager#getAppWidgetOptions getAppWidgetOptions()}, which returns a {@link android.os.Bundle} that includes the following:

    + + +This callback was introduced in API Level 16 (Android 4.1). If you implement this callback, make sure that your app doesn't depend on it since it won't be called on older devices. +
    {@link android.appwidget.AppWidgetProvider#onDeleted(Context,int[])}
    This is called every time an App Widget is deleted from the App Widget host.
    @@ -533,12 +556,13 @@ you would like to receive the App Widget broadcasts directly, you can implement your own {@link android.content.BroadcastReceiver} or override the {@link android.appwidget.AppWidgetProvider#onReceive(Context,Intent)} callback. -The four Intents you need to care about are:

    +The Intents you need to care about are as follows: