1

I would like to enable a stack app-widget for Google TV. The problem I'm having is that I need to show next and previous views programmatically.

I'm currently using a layout with a StackView and 2 Buttons. I can successfully receive the clicks of the buttons in my receiver but the method it's supposed to work is not doing anything

Toast.makeText(context, "next", Toast.LENGTH_SHORT).show();
remoteViews.showNext(R.id.stackWidgetView);

Debugging, the instance of remoteViews seams to be correct and the toast is triggered.

As I understand from the official documentation, the method showNext(int) of the RemoteViews should trigger the showNext of the StackView
http://developer.android.com/reference/android/widget/RemoteViews.html#showNext(int)

The question is How can I trigger showNext() from the AppWidgetProvider

MariusBudin
  • 1,277
  • 1
  • 10
  • 21

1 Answers1

1

Did you call partiallyUpdateAppWidget (API11+, but much nicer because you don't have to re-create your adapter, and with StackWidget you shouldn't worry about lower versions anyway) or updateAppWidget on the AppWidgetManager with your remoteView?

For reference, docs for AppWidgetManager: http://developer.android.com/reference/android/appwidget/AppWidgetManager.html

zilinx
  • 1,052
  • 8
  • 18