|
1 | 1 | package de.codebucket.mkkm.service; |
2 | 2 |
|
3 | 3 | import android.app.NotificationManager; |
| 4 | +import android.app.PendingIntent; |
4 | 5 | import android.app.job.JobParameters; |
5 | 6 | import android.app.job.JobService; |
6 | 7 | import android.content.Context; |
| 8 | +import android.content.Intent; |
7 | 9 | import android.content.SharedPreferences; |
8 | 10 | import android.net.Uri; |
9 | 11 | import android.os.AsyncTask; |
|
19 | 21 |
|
20 | 22 | import de.codebucket.mkkm.MobileKKM; |
21 | 23 | import de.codebucket.mkkm.R; |
| 24 | +import de.codebucket.mkkm.activity.SplashActivity; |
22 | 25 | import de.codebucket.mkkm.database.model.Ticket; |
23 | 26 | import de.codebucket.mkkm.database.model.TicketDao; |
24 | 27 | import de.codebucket.mkkm.login.AccountUtils; |
@@ -53,8 +56,12 @@ public void run() { |
53 | 56 | continue; |
54 | 57 | } |
55 | 58 |
|
| 59 | + Intent intent = new Intent(MobileKKM.getInstance(), SplashActivity.class); |
| 60 | + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); |
| 61 | + |
56 | 62 | NotificationCompat.Builder builder = new NotificationCompat.Builder(MobileKKM.getInstance(), Const.ID.EXPIRY_NOTIFICATION_CHANNEL); |
57 | 63 | builder.setSmallIcon(R.drawable.ic_notification_kkm) |
| 64 | + .setContentIntent(PendingIntent.getActivity(MobileKKM.getInstance(), 0, intent, 0)) |
58 | 65 | .setContentTitle(getString(R.string.expiration_notification_title)) |
59 | 66 | .setContentText(getString(R.string.expiration_notification_msg, DATE_FORMAT.format(ticket.getExpireDate()))) |
60 | 67 | .setSound(Uri.parse(prefs.getString("notification_ringtone", null))) |
|
0 commit comments