Display "Not connected" in notification instead of no text when not connected

This commit is contained in:
Steven Luo 2011-08-16 02:10:11 -07:00 committed by Sebastian Kaspari
parent 4396e66954
commit fafbe1ca4a
2 changed files with 3 additions and 2 deletions

View File

@ -122,6 +122,7 @@
<string name="command_desc_whois">Get information about a user</string>
<string name="notification_running">Yaaic is running</string>
<string name="notification_not_connected">Not connected</string>
<string name="notification_connected">Connected to %1$s</string>
<string name="notification_disconnected">Disconnected from %1$s</string>
<string name="notification_mentions">New messages in: %1$s</string>

View File

@ -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);
}
}