0
多分愚かな質問ですが、私はすでにこれについて何時間も費やしています。 私はKotlinリスナー持っている:私は活動に特別な何かをやっていないよNotificationListenerServiceが作成されていない
<service
android:enabled="true"
android:name="pl.bmideas.michal.bmnotifier.MyNotificationListener"
android:label="@string/service_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
:
package pl.bmideas.michal.bmnotifier
public class MyNotificationListener : NotificationListenerService() {
private var apiService :BackendApi? = null;
override fun onCreate() {
Log.i("MyNotificationListener" , "Creating NotificationListenerService service")
super.onCreate()
(.........SOMETHING ELSE..............)
}
override fun onDestroy() {
super.onDestroy()
Log.i(TAG, "DESTROING")
(.........SOMETHING ELSE..............)
}
override fun onNotificationRemoved(sbn: StatusBarNotification) {
val sbnInfo = StatusBarNotificationExtended(sbn)
Log.i(TAG, "REMOVED")
}
override fun onNotificationPosted(sbn: StatusBarNotification) {
Log.i(TAG, "RECIVED`")
(.........SOMETHING ELSE..............)
}
companion object {
var TAG = "MyNotificationListener"
}
}
を、私の設定が見えますが、このように見えます。
はい - セキュリティオプションを確認しました。私のアプリは通知にアクセスできます。
はい - 私は私が唯一見ることができますlogcatでは代わりに完全なパッケージをドットで
にサービスを提供するために指してみました:私は活動中でこのサービスにbidnますしない限り、私はインスタンスを取得カント
12-23 12:56:54.989 889-889/? V/NotificationListeners: enabling notification listener for 0:
ComponentInfo{pl.bmideas.michal.bmnotifier/pl.bmideas.michal.bmnotifier.MyNotificationListener}
wchichはサービスを作成しますが、通知についてはlogcatに情報がありません。
お手伝いできますか?