Fix:port/android:Altered notification bar flag from FLAG_NO_CLEAR to FLAG_ONGOING_EV...
authorkorrosa <korrosa@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 21 Mar 2012 17:38:07 +0000 (17:38 +0000)
committerkorrosa <korrosa@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 21 Mar 2012 17:38:07 +0000 (17:38 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4983 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/android/src/org/navitproject/navit/Navit.java

index cac593e..65cd037 100644 (file)
@@ -274,13 +274,15 @@ public class Navit extends Activity
                // init translated text\r
                NavitTextTranslations.init();\r
                \r
-               // Setup a notification in the android notification bar, remove it in the exit() function\r
-               NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r
-               Notification notification = new Notification(R.drawable.icon,"Navit is running",0);\r
-               notification.flags = Notification.FLAG_NO_CLEAR;\r
+               // NOTIFICATION\r
+               // Setup the status bar notification            \r
+               // This notification is removed in the exit() function\r
+               NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);  // Grab a handle to the NotificationManager\r
+               Notification NavitNotification = new Notification(R.drawable.icon,"Navit started",System.currentTimeMillis());  // Create a new notification, with the text string to show when the notification first appears\r
                PendingIntent appIntent = PendingIntent.getActivity(getApplicationContext(), 0, getIntent(), 0);\r
-               notification.setLatestEventInfo(getApplicationContext(), "Navit running", "Navit still running", appIntent);\r
-               nm.notify(R.string.app_name, notification);\r
+               NavitNotification.setLatestEventInfo(getApplicationContext(), "Navit", "Navit running", appIntent);     // Set the text in the notification\r
+               NavitNotification.flags|=Notification.FLAG_ONGOING_EVENT;       // Ensure that the notification appears in Ongoing\r
+               nm.notify(R.string.app_name, NavitNotification);        // Set the notification\r
                \r
                // get the local language -------------\r
                Locale locale = java.util.Locale.getDefault();\r