2016-04-11 14 views
0

私はnotification.setLatestEventInfo(this、TAG、message、contentIntent)メソッドでメソッドが見つかりません。 build.gradeを変更する必要がありますか?notification.setLatestEventInfoが見つかりません

private void displayNotificationMessage(String message) { 
    Notification notification = new Notification(R.drawable.emo_im_winking, 
      message, System.currentTimeMillis()); 

    notification.flags = Notification.FLAG_NO_CLEAR; 

    PendingIntent contentIntent = 
      PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0); 

    notification.setLatestEventInfo(this, TAG, message, contentIntent); 

    notificationMgr.notify(0, notification); 
} 

これが私の現在のbuild.gradeです:

apply plugin: 'com.android.application' 


android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.androidbook.services.simplelocalservice" 
     minSdkVersion 19 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
} 

答えて

関連する問題