notification-listener

How to start the NotificationListenerService on Android

旧城冷巷雨未停 提交于 2020-01-24 09:26:11
问题 I would like to access notifications on a Android phone by using the NotificationListenerService. I checked lots of tutorials but I can't find where they call the service. Should I use bindService or startService on MainActivity? How should the intents look like? Can someone show me the syntax of this? Check out one of the service implementations I am studying: public class NLService extends NotificationListenerService { Context context; @Override public void onCreate() { super.onCreate();

Notification Listener Service does not work after app is crashed

萝らか妹 提交于 2020-01-19 14:21:30
问题 I have a problem on my app and I want to report this bug. I develope the app which can crawls notifications using NotificationListenerService. It works well. But NotificationListenerService class has the problem I think. Because, If the app is crashed, app can't crawl the notification at all, UNTIL the phone reboots. Is anyone who can solve this problem?? Please help me. The bug is very clear!! But It is not easy to find the solution .... 回答1: If do you have already permissions then: In your

OnListenerCOnnected in NotificationListenerService not being called

↘锁芯ラ 提交于 2020-01-03 18:01:42
问题 My app only does not work on Huawei and on other phones it does. Why??? I have that code in my MainActivity: package pl.ct8.wieprzco.wieprzwatch; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent=new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"); startActivity(intent); startService(new Intent(this,NotificationGetService

How to turn off vibration of Notifications in android

筅森魡賤 提交于 2019-12-23 04:14:17
问题 I'm developing an app that handles sound and vibration of apps' notifications . I am listening to notifications using NotificationListenerService . I am able to turn on or off notification's sound using AudioManager as follows: // It turns off notification's sound myAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true); // It turns on notification's sound myAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, false); I have also tried to turn on or off notification's

Call a notification listener inside a background service in android studio

喜夏-厌秋 提交于 2019-12-21 21:32:51
问题 I have a background service running and a notification listener. I want to call the notification listener from the background service and it does not seem to work. I have below my classes. 1. Main activity starts the service 2.MyService is the background service running 3. NLService is the notification listeners service I want to call inside the MyService MainActivity.java package com.example.notifyservice; import android.content.BroadcastReceiver; import android.content.Context; import

Android / Overriding with onResume() function of NotificationListenerService class

寵の児 提交于 2019-12-13 03:23:49
问题 In Android, I have to get read with all of the existing status bar notifications from my mobile app that have not been dismissed but also including ones that are previously posted and not necessarily that new notifications as they come in during every time activity of my own Android app has been resumed forever. Of course, by using getActiveNotifications() function in overridden onCreate() function of NotificationListenerService class, as follows: @Override public void onCreate() { super

How to implement SQLite database to store Bitmap Image and Text?

瘦欲@ 提交于 2019-12-11 15:46:28
问题 hello all i am developing an android application which listen to incoming whatsapp notification and show it in listView using NotificationListenerService . i need help in sqlite database to store notifications and retrieve data and show in listView. data is one Bitmap image and text string... following is code am trying.. databaseHandler public class DatabaseHandler extends SQLiteOpenHelper{ // Database Version private static final int DATABASE_VERSION = 1; // Database Name private static

Android onNotificationPosted is called twice for gmail and whatsApp

别说谁变了你拦得住时间么 提交于 2019-12-11 09:26:48
问题 I know this looks like a duplicate of Android NotificationListenerService onNotificationPosted fire twice and NotificationListenerService onNotificationPosted() called multiple times for single Notification when it is part of grouped notification, but I have tried their solutions and they don't seem to work. All I want to do is to have a background service that is counting the number of notifications a person gets on the phone and then just write that into a text file. It works fine for SMS

How to utilize Android Nougat's Direct Reply feature with a NotificationListener?

喜夏-厌秋 提交于 2019-12-09 08:36:35
问题 My app is using a NotificationListener to read out messages from various 3rd party apps, for example WhatsApp. So far I was able to send a reply if only one chat is unread, the code is below. However, in the case with WhatsApp, getNotification().actions returns a null object when more than two chats are unread, as the messages are bundled together. As you can see in the pictures below, if the notifications are extended there is an option to send a direct reply as well, therefore I am certain

How to turn off vibration of Notifications in android

懵懂的女人 提交于 2019-12-06 15:37:30
I'm developing an app that handles sound and vibration of apps' notifications . I am listening to notifications using NotificationListenerService . I am able to turn on or off notification's sound using AudioManager as follows: // It turns off notification's sound myAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true); // It turns on notification's sound myAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, false); I have also tried to turn on or off notification's vibration with following code but it didn't work on my phone which has Android KitKat 4.4.4 // to turn off