In my application, I want to list ALL home widgets. My code is as follows:
mWidgetInfoList = AppWidgetManager.getInstance(getActivity()).getInstalledProviders();
int count = 0;
for (AppWidgetProviderInfo one: mWidgetInfoList) {
Log.d(TAG, "onViewCreated, widget " + count + ": " + one.label + ", " + one.toString());
count++;
}
It works almost fine. The question arises: it getInstalledProviders()simply returns an incomplete list. For example, in my Samsung Note3 (Android 5.0) two widgets that are not returned getInstalledProviders()are “S Planner”, which are two size calendar widgets, as shown by Samsung TouchWiz.
But there is another widget not shown by TouchWiz, which is the "Calendar". The magazine shows that he is actually an S-scheduler:
05-04 16:23:12.977 30699-30699/com.lxj.simplehome D/WidgetListFragment﹕ onViewCreated, widget 16: Calendar, AppWidgetProviderInfo(provider=ComponentInfo{com.sec.android.widgetapp.SPlannerAppWidget/com.sec.android.widgetapp.SPlannerAppWidget.EasyWidget.EasyCalendarAppWidgetProvider})
So how to get a complete list (with different sizes)?
source
share