• Stars
    star
    255
  • Rank 159,729 (Top 4 %)
  • Language
    Java
  • Created over 11 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NotificationListenerService Example

NotificationListenerService-Example

##Introduction NotificationListenerService is introduced in Android 4.3 (API 18). It allows an application to receive information about notifications as it creates or removes. NotificationListenerService class is derived from the Service class. It has two abstract methods namely 1. onNotificationPosted 2. onNotificationRemoved.
To use NotificationListenerService, we need to create a java file which extends NotificationListenerService and implement two callback methods. Both methods have a parameter named "sbn", which is an object of StatusBarNotification class. StatusBarNotification provides necessary information about Notifications. NotificationListenerService provides facility to fetch active notifications using getActiveNotifications and also provides a feature to remove notifications using cancelAllNotifications.

##Useful Methods

  1. NotificationListenerService
    • onNotificationPosted
    • onNotificationRemoved
  2. StatusBarNotification
    • getId
    • getNotification
    • getPackageName
    • getPostTime
    • isClearable
    • isOngoing

##Note User require to enable notification permission from "Settings > Security > Notification access".

Mou icon Mou icon Mou icon Mou icon

More Repositories

1

chips-edittext-library

Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android
380
star
2

Android-Image-Filters

Java
117
star
3

chipsedittext

Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android
Java
70
star
4

android-global-touchevent

Android Detect Global Touch Event
Java
62
star
5

GooglePlusLoginUtil

Android : Login with Google Plus Utility class,
Java
54
star
6

volley-example

Example : Volley: Easy, Fast Networking for Android
Java
48
star
7

fused-location-provider-example

Fused Location Provider Example
Java
38
star
8

SimpleSyncAdapter

Android Simple Sync Adapter Tutorial
Java
23
star
9

android-instagram-integration

tutorial for android instagram integration
Java
9
star
10

TriangleTabs

Extension of PagerSlidingTabStrip
Java
8
star
11

MyActivityRecognition

Android Activity Recognition Example
Java
7
star
12

golang_random_string

Go Lang Fastest way to generate random string
Go
6
star
13

Hello-SmartWatch

Demo application for Sony's SmartWatch
Java
5
star
14

google-play-service

Tutorial for Google Play Service Authorization
Java
4
star
15

pcache

Persistence Cache for Go Lang
Go
4
star
16

FacebookLoginUtil

Android Login with Facebook
Java
3
star
17

kpbird.github.io

My Personal Blog
HTML
2
star
18

AWS-EC2-Java-Tutorial

Java
2
star
19

kpbird

1
star
20

merge_demo

1
star
21

nothing

Name on commit
1
star