GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kpbird/NotificationListenerService-Example: NotificationListenerService Example

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
NLSExample
NLSExample
 
 
gradle/wrapper
gradle/wrapper
 
 
NLSExampleProject.iml
NLSExampleProject.iml
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
local.properties
local.properties
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

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

About

NotificationListenerService Example

Resources

Readme
Activity

Stars

260 stars

Watchers

24 watching

Forks

127 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.