.URI_INTENT_SCHEME final RemoteViews rv new RemoteViewscontext.getPackageName R.layout.widget_layout rv.setRemoteAdapterappWidgetIdsi R.id.weather_list intent // Set the empty view to be displayed if the collection is empty. It must be a sibling // view of the collection view. rv.setEmptyViewR.id.weather_list R.id.empty_view // Bind a click listener template for the contents of the weather list. Note that we // need to update the intents data if we set an extra since the extras will be // ignored otherwise. final Intent onClickIntent new Intentcontext WeatherWidgetProvider.class onClickIntent.setActionWeatherWidgetProvider.CLICK_ACTION onClickIntent.putExtraAppWidgetManager.EXTRA_APPWIDGET_ID appWidgetIdsi onClickIntent.setDataUri.parseonClickIntent.toUriIntent.URI_INTENT_SCHEME final PendingIntent onClickPendingIntent PendingIntent.getBroadcastcontext 0 onClickIntent PendingIntent.FLAG_UPDATE_CURRENT rv.setPendingIntentTemplateR.id.weather_list onClickPendingIntent // Bind the click intent for the refresh button on the widget final Intent refreshIntent new Intentcontext WeatherWidgetProvider.class refreshIntent.setActionWeatherWidgetProvider.REFRESH_ACTION final PendingIntent refreshPendingIntent PendingIntent.getBroadcastcontext 0 refreshIntent PendingIntent.FLAG_UPDATE_CURRENT rv.setOnClickPendingIntentR.id.refresh refreshPendingIntent appWidgetManager.updateAppWidgetappWidgetIdsi rv super.onUpdatecontext appWidgetManager appWidgetIds
上一篇:
a android 源码
下一篇:
改变自己从改变思想开始