0

In my app I have a 4x2 Widget and now I wanted a second 4x1 Widget displayig almost the same content, so I created a secondary appwidget-provider xml. When I then wanted to use the same Widgetprovider Android only showed one widget in the list. :-(

As I found out, you have to use for each Widget defined in the Manifest another widgetprovider... why? how to add multiple widgets in one app?

Furthermore I would liek to have only one widget entry in the List... Can I change the appwidget-provider xml in the AppWidgetConfig Activity so that I don't have to use the initial size? how?

Community
  • 1
  • 1
Tobias
  • 7,282
  • 6
  • 63
  • 85

1 Answers1

1

you have to use for each Widget defined in the Manifest another widgetprovider... why?

Because that is the way they wrote it.

Furthermore I would liek to have only one widget entry in the List

Then only define one AppWidgetProvider for only one size of app widget.

Can I change the appwidget-provider xml in the AppWidgetConfig Activity so that I don't have to use the initial size?

No.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • So it's not possible to build a widget like the weather widget on htc which is only listed once but the layout (and so its size) can be choosen in the widget configuration dialog? – Tobias Nov 24 '11 at 23:01
  • 1
    @LordFlash: AFAIK, that's not an app widget. It's a feature of that home screen. To test this theory, install some other third-party home screen on that device, and try adding the HTC weather widget to that alternative home screen. Also, home screens are welcome to give users the flexibility to have larger app widget dimensions via some sort of dialog, but developers have no way to force it. – CommonsWare Nov 25 '11 at 00:02