2011-01-27 3 views

ответ

5

Вы хотите использовать Android.App.Notification и Android.App.NotificationManager, например, из LocalService.ShowNotification():

// within some Android.Content.Context subclass (Activity, Service, etc.) 
void ShowNotification() 
{ 
    IEnumerable<char> text = GetText (Resource.String.local_service_started); 
    var notification = new Notification (Resource.Drawable.stat_sample, 
      text, 
      System.Environment.TickCount); 
    PendingIntent contentIntent = PendingIntent.GetActivity (this, 0, 
      new Intent (this, typeof (LocalServiceActivities.Controller)), 
      0); 
    notification.SetLatestEventInfo (this, 
      GetText ([email protected]_service_label), 
      text, 
      contentIntent); 
    var nm = (NotificationManager) GetSystemService (NotificationService); 
    nm.Notify (Resource.String.local_service_started, notification); 
} 

 Смежные вопросы

  • Нет связанных вопросов^_^