- /**
- * Show a notification while this service is running.
- */
- private void showNotification() {
- // In this sample, we'll use the same text for the ticker and the expanded notification
- CharSequence text = getText(R.string.telemetry_service_started);
-
- // Set the icon, scrolling text and timestamp
- Notification notification = new Notification(R.drawable.am_status, text,
- System.currentTimeMillis());
-
- // The PendingIntent to launch our activity if the user selects this notification
- PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
- new Intent(this, TelemetryServiceActivities.Controller.class), 0);
-
- // Set the info for the views that show in the notification panel.
- notification.setLatestEventInfo(this, getText(R.string.telemetry_service_label),
- text, contentIntent);
-
- // Send the notification.
- mNM.notify(NOTIFICATION, notification);
- }