【问题标题】:Android widget, how to use notifyAppWidgetViewDataChanged in Android API <11Android小部件,如何在Android API <11中使用notifyAppWidgetViewDataChanged
【发布时间】:2012-10-24 00:42:51
【问题描述】:

我想更新我的小部件以兼容 Android 2.3.3 (API 10)。

我的代码有问题。

以下方法在 minsdkversion = 10 时无法识别。

如何在我的 APPwidgetProvider 类中替换它们,以便在 Android 2.3.3、3.0 .... 4.0 中使用我的小部件?

rv.setRemoteAdapter(appWidgetIds[i], R.id.stack_view, intent);
rv.setEmptyView(R.id.stack_view, R.id.empty_view);
rv.setPendingIntentTemplate(R.id.stack_view, toastPendingIntent);
appWidgetManager.notifyAppWidgetViewDataChanged(i, R.id.stack_view);

【问题讨论】:

    标签: android android-widget android-appwidget appwidgetprovider


    【解决方案1】:

    集合视图是从 API 11 引入的,因此您不能使用堆栈视图。

    http://developer.android.com/guide/topics/appwidgets/index.html#collections

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-19
      • 2014-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-04
      相关资源
      最近更新 更多