【发布时间】:2017-02-10 12:09:38
【问题描述】:
我和here 有同样的问题。我想应用已接受的答案。但我无法做到这一点,因为 IDE 在该行中声明:
Thread.currentThread().wait();
“wait”是一个未解决的引用。我在 Android Studio 中使用 kotlin,所以可能是 kotlin 插件导致了问题。在 Preferences 的插件部分中声明我安装了 1.0.6-release-Studio2.2-1 kotlin 版本。而在项目 build.gradle 中:
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:2.3.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
如果我将 kotlin_version 更改为 1.0.6-release-Studio2.2-1 Ide 指出Kotlin version that is used for building with Gradle (1.0.6-release-Studio2.2-1) differs from the one bundled into the IDE plugin (1.0.6)。
所以我的第一个问题是如何处理未解决的引用错误。 第二个:是否有其他/更好的方法来强制 IntentService 等到 DownloadManager 完成下载并按照this 问题中的要求调用 onReceive()。
【问题讨论】:
标签: android