Dantotsu/app/src/main/java/ani/dantotsu/subcriptions/NotificationClickReceiver.kt
rebelonion 664b5a4bdd ???
2024-01-18 01:09:30 -06:00

21 lines
No EOL
672 B
Kotlin

package ani.dantotsu.subcriptions
import android.app.NotificationManager
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import ani.dantotsu.INCOGNITO_CHANNEL_ID
class NotificationClickReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent?) {
context.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit()
.putBoolean("incognito", false)
.apply()
val notificationManager =
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.cancel(INCOGNITO_CHANNEL_ID)
}
}