Changeset View
Changeset View
Standalone View
Standalone View
src/android/org/kde/knotifications/NotifyByAndroid.java
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 64 | { | |||
---|---|---|---|---|---|
92 | 92 | | |||
93 | // taping the notification shows the app | 93 | // taping the notification shows the app | ||
94 | Intent intent = new Intent(m_ctx.getPackageName() + NOTIFICATION_OPENED); | 94 | Intent intent = new Intent(m_ctx.getPackageName() + NOTIFICATION_OPENED); | ||
95 | intent.putExtra(NOTIFICATION_ID_EXTRA, notification.id); | 95 | intent.putExtra(NOTIFICATION_ID_EXTRA, notification.id); | ||
96 | PendingIntent contentIntent = PendingIntent.getBroadcast(m_ctx, m_uniquePendingIntentId++, intent, PendingIntent.FLAG_UPDATE_CURRENT); | 96 | PendingIntent contentIntent = PendingIntent.getBroadcast(m_ctx, m_uniquePendingIntentId++, intent, PendingIntent.FLAG_UPDATE_CURRENT); | ||
97 | builder.setContentIntent(contentIntent); | 97 | builder.setContentIntent(contentIntent); | ||
98 | 98 | | |||
99 | // actions | 99 | // actions | ||
100 | int actionId = 0; | 100 | int actionId = 1; | ||
101 | for (String actionName : notification.actions) { | 101 | for (String actionName : notification.actions) { | ||
102 | Intent actionIntent = new Intent(m_ctx.getPackageName() + NOTIFICATION_ACTION); | 102 | Intent actionIntent = new Intent(m_ctx.getPackageName() + NOTIFICATION_ACTION); | ||
103 | actionIntent.putExtra(NOTIFICATION_ID_EXTRA, notification.id); | 103 | actionIntent.putExtra(NOTIFICATION_ID_EXTRA, notification.id); | ||
104 | actionIntent.putExtra(NOTIFICATION_ACTION_ID_EXTRA, actionId); | 104 | actionIntent.putExtra(NOTIFICATION_ACTION_ID_EXTRA, actionId); | ||
105 | PendingIntent pendingIntent = PendingIntent.getBroadcast(m_ctx, m_uniquePendingIntentId++, actionIntent, PendingIntent.FLAG_UPDATE_CURRENT); | 105 | PendingIntent pendingIntent = PendingIntent.getBroadcast(m_ctx, m_uniquePendingIntentId++, actionIntent, PendingIntent.FLAG_UPDATE_CURRENT); | ||
106 | Notification.Action action = new Notification.Action.Builder(0, actionName, pendingIntent).build(); | 106 | Notification.Action action = new Notification.Action.Builder(0, actionName, pendingIntent).build(); | ||
107 | builder.addAction(action); | 107 | builder.addAction(action); | ||
108 | ++actionId; | 108 | ++actionId; | ||
Show All 39 Lines |