Ich versucheAusgabe mit appcompat-v7 und NotificationManagerCompat
NotificationManagerCompat.from(this).areNotificationsEnabled()
zu bestimmen, zu verwenden, wenn Push-Benachrichtigungen für meinen app oder nicht erlaubt ist. Allerdings ist es nicht mit diesem Fehler kompiliert:
error: cannot find symbol
Log.d(TAG, "Allowed PushNotes: " + NotificationManagerCompat.from(this).areNotificationsEnabled());
^
symbol: method areNotificationsEnabled()
location: class NotificationManagerCompat
Es ist wie folgt importiert:
import android.support.v4.app.NotificationManagerCompat;
Dies sind die Teile des build.gradle relevant für diesen Ich denke,:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example"
minSdkVersion 16
targetSdkVersion 22
versionCode 10
versionName "1.9"
ndk {
abiFilters "armeabi-v7a", "x86"
}
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
}
Und das ist die Abhängigkeit:
dependencies {
compile "com.android.support:appcompat-v7:23.4.0"