Je suis nouveau sur android. Je veux maintenant comment créer une barre de notification d'état dans la page d'accueil. Quelqu'un peut-il m'aider avec certains codes. Merci d'avance.Barre d'état Android Notification
2
A
Répondre
5
notificationManager = (NotificationManager)_context.getSystemService(Context.NOTIFICATION_SERVICE);
long when = System.currentTimeMillis();
int _icon=R.drawable.icon;
Intent intent = new Intent(_context, your_file.class);
PendingIntent contentIntent = PendingIntent.getActivity(_context, 0, intent, 0);
Notification notification = new Notification(_icon,_text,when);
notification.setLatestEventInfo(_context, _title, _contentText, contentIntent);
int NOTIFICATION_ID = 10;
notificationManager.notify(NOTIFICATION_ID, notification);
Pour annuler la notification
notificationManager.cancel(NOTIFICATION_ID);
1
Regardez-le: Android Status Bar
Questions connexes
- 1. Comment supprimer la barre de notification android?
- 2. Notification Android
- 3. Masquer la barre de notification
- 4. Android: événement Cliquez pour la notification barre d'état
- 5. Implémentation d'une notification interactive dans la barre d'état (Android)
- 6. Cercle rouge vide dans la barre d'état de notification Android!
- 7. La barre de notification Android ouvre la dernière activité active?
- 8. Android - icône de notification de barre d'état incrémentielle
- 9. supprimer l'ombre de la barre de notification dans l'application Android
- 10. barre de notification/notification en conflit avec une vue personnalisée?
- 11. Notification retardée Android
- 12. multiples Notification android
- 13. Notification Android NullPointer
- 14. Service Android avec notification
- 15. Notification sms Android
- 16. R.string.value Aide notification Android
- 17. Android affichage de la notification étendue
- 18. Actualiser la barre de progression dans la barre de notification
- 19. Android obtenir des données de notification GTALK
- 20. Android barre de recherche dans la barre d'état
- 21. Android: aucune icône pour la notification
- 22. notification push dans android 1.6
- 23. Android SDK web-push-notification?
- 24. android push notification service comparaison
- 25. comment créer « SEULEMENT NOTIFICATION barre d'état comme l'horloge d'alarme, batterie, 3g android sans tiroir extensible
- 26. android - Désactiver la possibilité de faire glisser vers le bas de la barre de notification
- 27. Android: Ajouter un bouton dans une notification de la barre d'état
- 28. Android: notification de groupe dans la barre d'état, mais pas dans la liste des notifications
- 29. Android Barre d'état Notifications - Ouverture de l'activité correcte lors de la sélection d'une notification
- 30. Désactiver la notification des SMS entrants/sortants dans android
comment nous pouvons montrer le pourcentage dowload dans la boîte de dialogue de progression dans la notification d'état de bar ...? –
@kamal: http://united-coders.com/nico-heid/show-progressbar-in-notification-area-like-google-does-when-downloading-from-android – viv
Mais comment ajouter les progrès de 55% sous la barre de progression ...? –