Created
March 26, 2012 22:42
-
-
Save jeserkin/2210346 to your computer and use it in GitHub Desktop.
Notification in android environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NotificationManager nm = ( NotificationManager ) getSystemService( NOTIFICATION_SERVICE ); | |
Notification notify = new Notification( android.R.drawable.stat_notify_more, "30 seconds ago you did something special and now it is over", ( System.currentTimeMillis() + 30000 ) ); | |
Context context = QuizManager.this; | |
String title = "You were notified!"; | |
String details = "You were notified about something!"; | |
Intent intent = new Intent( context, QuizManager.class ); | |
PendingIntent pi = PendingIntent.getActivity( context, 0, intent, 0 ); | |
notify.setLatestEventInfo( context, title, details, pi ); | |
nm.notify( 0, notify ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment