Fix notification intent (#89)

This commit is contained in:
Rafał Borcz 2018-04-24 23:52:53 +02:00 committed by Mikołaj Pich
parent 119e38254a
commit 176d17e1ec
3 changed files with 4 additions and 3 deletions

View File

@ -36,7 +36,8 @@
<activity <activity
android:name=".ui.main.MainActivity" android:name=".ui.main.MainActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/activity_dashboard_text" /> android:label="@string/activity_dashboard_text"
android:launchMode="singleTop" />
<service <service
android:name=".services.jobs.SyncJob" android:name=".services.jobs.SyncJob"

View File

@ -95,7 +95,7 @@ public class SyncJob extends SimpleJobService {
.setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0, .setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0,
MainActivity.getStartIntent(getApplicationContext()) MainActivity.getStartIntent(getApplicationContext())
.putExtra(MainActivity.EXTRA_CARD_ID_KEY, 0) .putExtra(MainActivity.EXTRA_CARD_ID_KEY, 0)
, 0 , PendingIntent.FLAG_UPDATE_CURRENT
)) ))
.build()); .build());
} }

View File

@ -57,7 +57,7 @@ public class TimetableWidgetProvider extends AppWidgetProvider {
private void setToggleIntent(RemoteViews views, Context context) { private void setToggleIntent(RemoteViews views, Context context) {
Intent refreshIntent = new Intent(context, TimetableWidgetProvider.class); Intent refreshIntent = new Intent(context, TimetableWidgetProvider.class);
refreshIntent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE); refreshIntent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 1,
refreshIntent, PendingIntent.FLAG_UPDATE_CURRENT); refreshIntent, PendingIntent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.timetable_widget_toggle, pendingIntent); views.setOnClickPendingIntent(R.id.timetable_widget_toggle, pendingIntent);
} }