2017-02-13 1 views
0

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" 

Antwort

0

In App Gradle Datei sollte com.android.support:support mindestens 24 compileSdkVersion 24 sein müssen sein

android { 
    compileSdkVersion 24 

} 

dependencies { 
    compile 'com.android.support:support-v4:24.0.0' 
} 
0

Kompilierung "com.android.support:support-v4:24.0.0"

Verwandte Themen