use of android.appwidget.AppWidgetManager in project Fairphone by Kwamecorp.
the class LauncherTransitionable method updateAppSwitcherWidgets.
public void updateAppSwitcherWidgets() {
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(this, WidgetProvider.class));
if (appWidgetIds.length > 0) {
new WidgetProvider().onUpdate(this, appWidgetManager, appWidgetIds);
}
}
use of android.appwidget.AppWidgetManager in project k-9 by k9mail.
the class MessageListWidgetProvider method triggerMessageListWidgetUpdate.
public static void triggerMessageListWidgetUpdate(Context context) {
Context appContext = context.getApplicationContext();
AppWidgetManager widgetManager = AppWidgetManager.getInstance(appContext);
ComponentName widget = new ComponentName(appContext, MessageListWidgetProvider.class);
int[] widgetIds = widgetManager.getAppWidgetIds(widget);
Intent intent = new Intent(context, MessageListWidgetProvider.class);
intent.setAction(ACTION_UPDATE_MESSAGE_LIST);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, widgetIds);
context.sendBroadcast(intent);
}
use of android.appwidget.AppWidgetManager in project k-9 by k9mail.
the class MessageListWidgetProvider method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
String action = intent.getAction();
if (action.equals(ACTION_UPDATE_MESSAGE_LIST)) {
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
int[] appWidgetIds = intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS);
appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listView);
}
}
use of android.appwidget.AppWidgetManager in project qksms by moezbhatti.
the class WidgetProvider method notifyThemeChanged.
public static void notifyThemeChanged(Context context) {
if (context != null) {
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, WidgetProvider.class));
for (int appWidgetId : appWidgetIds) {
updateWidget(context, appWidgetId, isSmallWidget(appWidgetManager, appWidgetId));
}
}
notifyDatasetChanged(context);
}
use of android.appwidget.AppWidgetManager in project Timber by naman14.
the class BaseWidget method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action != null && action.startsWith("com.naman14.timber.")) {
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
ComponentName thisAppWidget = new ComponentName(context.getPackageName(), this.getClass().getName());
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisAppWidget);
onUpdate(context, appWidgetManager, appWidgetIds);
} else {
super.onReceive(context, intent);
}
}
Aggregations