mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-22 08:52:18 -05:00
Add FLAG_ACTIVITY_NEW_TASK to notification intents
According to http://developer.android.com/reference/android/app/Notification.html#contentIntent we should do this. Suppresses a log message when tapping on our status bar notification.
This commit is contained in:
parent
caf3272f71
commit
464430ee74
@ -169,7 +169,9 @@ public class IRCService extends Service
|
||||
notification = new Notification(R.drawable.icon, "", System.currentTimeMillis());
|
||||
|
||||
// The PendingIntent to launch our activity if the user selects this notification
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, ServersActivity.class), 0);
|
||||
Intent notifyIntent = new Intent(this, ServersActivity.class);
|
||||
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notifyIntent, 0);
|
||||
|
||||
// Set the info for the views that show in the notification panel.
|
||||
notification.setLatestEventInfo(this, getText(R.string.app_name), "", contentIntent);
|
||||
@ -201,7 +203,9 @@ public class IRCService extends Service
|
||||
if (foreground) {
|
||||
notificationManager.cancel(R.string.app_name);
|
||||
notification = new Notification(R.drawable.icon, text, System.currentTimeMillis());
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, ServersActivity.class), 0);
|
||||
Intent notifyIntent = new Intent(this, ServersActivity.class);
|
||||
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notifyIntent, 0);
|
||||
notification.setLatestEventInfo(this, getText(R.string.app_name), text, contentIntent);
|
||||
|
||||
if (vibrate) {
|
||||
|
Loading…
Reference in New Issue
Block a user