私は最近API 26にアプリケーションを更新しました。コードを変更することなく通知が機能しなくなりました。APIで表示されないAndroid通知
val notification = NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle("Title")
.setContentText("Text")
.build()
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).notify(1, notification)
なぜ機能しないのですか?私が気づいていないAPIにいくつかの変更がありましたか? the documentationから
あなたの 'targetSdkVersion'とは何ですか? – CommonsWare
@CommonsWare 'targetSdkVersion' 26、' minSdkVersion' 21、 'compileSdkVersion' 26、' buildToolsVersion' 26.0.0です。私はAndroid O DP3を実行している電話でもこれを実行しています。 – Aaron