diff options
author | Joe Onorato <joeo@google.com> | 2011-01-10 22:58:05 -0800 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2011-01-11 11:57:52 -0800 |
commit | 2c1a63fe9926839dd2cdfe865e749f83c26bf3ca (patch) | |
tree | 058aff77f509c5e543fd2baa209981b25389a4e0 /tests/appwidgets/AppWidgetHostTest | |
parent | 033376f6f0cb65f4cf5862c92ca0bf8ad5895566 (diff) | |
download | frameworks_base-2c1a63fe9926839dd2cdfe865e749f83c26bf3ca.zip frameworks_base-2c1a63fe9926839dd2cdfe865e749f83c26bf3ca.tar.gz frameworks_base-2c1a63fe9926839dd2cdfe865e749f83c26bf3ca.tar.bz2 |
Update AppWidgetHostActivity to work again.
Change-Id: I301b59ef49423d45b052edb350856421c7844fba
Diffstat (limited to 'tests/appwidgets/AppWidgetHostTest')
-rw-r--r-- | tests/appwidgets/AppWidgetHostTest/src/com/android/tests/appwidgethost/AppWidgetHostActivity.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/appwidgets/AppWidgetHostTest/src/com/android/tests/appwidgethost/AppWidgetHostActivity.java b/tests/appwidgets/AppWidgetHostTest/src/com/android/tests/appwidgethost/AppWidgetHostActivity.java index bb0fa60..2c8c5ba 100644 --- a/tests/appwidgets/AppWidgetHostTest/src/com/android/tests/appwidgethost/AppWidgetHostActivity.java +++ b/tests/appwidgets/AppWidgetHostTest/src/com/android/tests/appwidgethost/AppWidgetHostActivity.java @@ -46,14 +46,22 @@ public class AppWidgetHostActivity extends Activity AppWidgetContainerView mAppWidgetContainer; public AppWidgetHostActivity() { - mAppWidgetManager = AppWidgetManager.getInstance(this); } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); + mAppWidgetManager = AppWidgetManager.getInstance(this); + setContentView(R.layout.appwidget_host); + mHost = new AppWidgetHost(this, HOST_ID) { + protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) { + return new MyAppWidgetView(appWidgetId); + } + }; + + findViewById(R.id.add_appwidget).setOnClickListener(mOnClickListener); mAppWidgetContainer = (AppWidgetContainerView)findViewById(R.id.appwidget_container); @@ -188,11 +196,7 @@ public class AppWidgetHostActivity extends Activity } } - AppWidgetHost mHost = new AppWidgetHost(this, HOST_ID) { - protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) { - return new MyAppWidgetView(appWidgetId); - } - }; + AppWidgetHost mHost; } |