【发布时间】:2019-02-17 15:47:25
【问题描述】:
我正在尝试实现Playback Notifications with ExoPlayer。但是缺少 getTitle、getDescription、createPendingIntent()、getLargeIcon 并且 android studio 显示红色(无法解析方法)。我怎样才能得到这些?
我编写的代码与链接完全相同。我试了很多次。
这是我的 build.gradle 文件(如果需要):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.mediaplayertest"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.android.support:support-media-compat:28.0.0"
implementation "com.android.support:support-compat:28.0.0"
implementation 'com.google.android.exoplayer:exoplayer:2.9.5'
}
【问题讨论】:
标签: android audio exoplayer exoplayer2.x