I am working over widget where I need to control the width and height of widget programmatically when device rotates from portrait to landscape and landscape to protrait. For this when configuration change I call the below code to update the widget width programmatically:
for (int id : appWidgetIds){
Bundle newOptions = appWidgetManager.getAppWidgetOptions(id);
int minWidth = newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, 0);
newOptions.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, minWidth - 100);
appWidgetManager.updateAppWidgetOptions(id, newOptions);
}
After this, I get call onAppWidgetOptionsChanged() with new values but widget don't get resized.
However I am also calling onUpdate().
minSdkVersion is 16.
I searched a lot but could not find related to this problem, thanks if advance for your valuable time.
Thanks