Code example for NotificationManager

Methods: cancelAll

0
	private static final String TAG = "NotifierHelper";
    private static final int NOTIFY_1 = 0x1001;
 
    public static void clear(Context caller) {
        NotificationManager notifier = (NotificationManager) caller.getSystemService(Context.NOTIFICATION_SERVICE);
        notifier.cancelAll();
    } 
     
    // display customized Toast message 
    public static int SHORT_TOAST = 0;
    public static int LONG_TOAST = 1;
    public static void displayToast(Context caller, String toastMsg, int toastType){
         
    	try {// try-catch to avoid stupid app crashes 
	        LayoutInflater inflater = LayoutInflater.from(caller);
	         
	        View mainLayout = inflater.inflate(R.layout.toast_layout, null);
	        View rootLayout = mainLayout.findViewById(R.id.toast_layout_root);
	        
	        ImageView image = (ImageView) mainLayout.findViewById(R.id.image);
	        image.setImageResource(R.drawable.img_icon_notification);