From fafbe1ca4a399b5b96ae096b81161385ef57af3c Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Tue, 16 Aug 2011 02:10:11 -0700 Subject: [PATCH] Display "Not connected" in notification instead of no text when not connected --- application/res/values/strings.xml | 1 + application/src/org/yaaic/irc/IRCService.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/res/values/strings.xml b/application/res/values/strings.xml index 7c6c9d0..fe84700 100644 --- a/application/res/values/strings.xml +++ b/application/res/values/strings.xml @@ -122,6 +122,7 @@ Get information about a user Yaaic is running + Not connected Connected to %1$s Disconnected from %1$s New messages in: %1$s diff --git a/application/src/org/yaaic/irc/IRCService.java b/application/src/org/yaaic/irc/IRCService.java index b7890d7..df1f9bc 100644 --- a/application/src/org/yaaic/irc/IRCService.java +++ b/application/src/org/yaaic/irc/IRCService.java @@ -197,7 +197,7 @@ public class IRCService extends Service 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); + notification.setLatestEventInfo(this, getText(R.string.app_name), getText(R.string.notification_not_connected), contentIntent); startForegroundCompat(FOREGROUND_NOTIFICATION, notification); } else if (ACTION_BACKGROUND.equals(intent.getAction()) && !foreground) { @@ -237,7 +237,7 @@ public class IRCService extends Service } contentText = getString(R.string.notification_connected, sb.substring(0, sb.length()-2)); } else { - contentText = ""; + contentText = getString(R.string.notification_not_connected); } }