Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.app.NotificationManager;

import android.content.Context;

import android.support.annotation.NonNull;

public class Main {
    public static final int NOTIFICATION_ID = 20111;

    public static void cancelNotification(@NonNull Context context, int id) {
        int finalId = id == 0 ? NOTIFICATION_ID : id;
        NotificationManager notificationManager = (NotificationManager) context
                .getSystemService(Context.NOTIFICATION_SERVICE);
        notificationManager.cancel(finalId);
    }
}