Get the NotificationManager for the device - Android Android OS

Android examples for Android OS:Notification

Description

Get the NotificationManager for the device

Demo Code


//package com.java2s;

import android.app.NotificationManager;
import android.content.Context;

public class Main {
    /**/*from w ww . j a v  a2s . c  o m*/
     * Get the NotificationManager for the device
     * @param context The Context to use
     * @return The NotificationManager
     */
    public static NotificationManager getNotificationManager(Context context) {
        return (NotificationManager) context
                .getSystemService(Context.NOTIFICATION_SERVICE);
    }
}

Related Tutorials