diff options
Diffstat (limited to 'org.fox.ttrss')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java | 3 | ||||
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/widget/SmallWidgetProvider.java | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java index 1f702e5b..2a80466e 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java @@ -510,7 +510,8 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc AlarmManager alarmManager = (AlarmManager)context.getSystemService(ALARM_SERVICE); - Intent intentUpdate = new Intent(SmallWidgetProvider.ACTION_REQUEST_UPDATE); + Intent intentUpdate = new Intent(context, SmallWidgetProvider.class); + intentUpdate.setAction(SmallWidgetProvider.ACTION_REQUEST_UPDATE); PendingIntent pendingIntentAlarm = PendingIntent.getBroadcast(context, 0, intentUpdate, PendingIntent.FLAG_UPDATE_CURRENT); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/SmallWidgetProvider.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/SmallWidgetProvider.java index 95d66289..ddc602cd 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/SmallWidgetProvider.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/SmallWidgetProvider.java @@ -48,8 +48,6 @@ public class SmallWidgetProvider extends AppWidgetProvider { } appWidgetManager.updateAppWidget(appWidgetIds, views); - - JobIntentService.enqueueWork(context.getApplicationContext(), WidgetUpdateService.class, 0, new Intent()); } @Override @@ -61,6 +59,14 @@ public class SmallWidgetProvider extends AppWidgetProvider { int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisAppWidget); onUpdate(context, appWidgetManager, appWidgetIds); + + if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(intent.getAction()) || + ACTION_REQUEST_UPDATE.equals(intent.getAction())) { + + Log.d(TAG, "sheduling widget update..."); + + JobIntentService.enqueueWork(context.getApplicationContext(), WidgetUpdateService.class, 0, new Intent()); + } } } |