Skip to content

Commit

Permalink
更新README以反映依赖项添加的正确gradle代码
Browse files Browse the repository at this point in the history
  • Loading branch information
dxmwl committed Aug 4, 2024
1 parent 4c7d0ea commit c007f69
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,35 @@
}
}
```
5. 检查版本更新,//注意返回结果后要在主线程中执行更新UI的操作
```kotlin
UpDateApp.checkUpdate(object : Callback {
override fun result(updateInfo: UpdateChecker.UpdateInfo?) {
//注意这里要在主线程中执行更新UI的操作
runOnUiThread {
AlertDialog.Builder(this@MainActivity)
.setTitle("版本更新")
.setMessage(
"是否强制更新:${updateInfo?.needForceUpdate}\n" +
"应用安装地址:${updateInfo?.downloadURL}\n" +
"版本号:${updateInfo?.buildVersion}\n" +
"应用更新说明:${updateInfo?.buildUpdateDescription}"
)
.show()
}
}
5. 检查版本更新,//注意返回结果后要在主线程中执行更新UI的操作
```kotlin
UpDateApp.checkUpdate(object : Callback {
override fun result(updateInfo: UpdateChecker.UpdateInfo?) {
//注意这里要在主线程中执行更新UI的操作
runOnUiThread {
AlertDialog.Builder(this@MainActivity)
.setTitle("版本更新")
.setMessage(
"是否强制更新:${updateInfo?.needForceUpdate}\n" +
"应用安装地址:${updateInfo?.downloadURL}\n" +
"版本号:${updateInfo?.buildVersion}\n" +
"应用更新说明:${updateInfo?.buildUpdateDescription}"
)
.show()
}
}
override fun error(message: String?) {
Log.e(TAG, "error: $message")
//注意这里要在主线程中执行更新UI的操作
runOnUiThread {
Toast.makeText(this@MainActivity, "错误信息:${message}", Toast.LENGTH_SHORT)
.show()
}
}
override fun error(message: String?) {
Log.e(TAG, "error: $message")
//注意这里要在主线程中执行更新UI的操作
runOnUiThread {
Toast.makeText(this@MainActivity, "错误信息:${message}", Toast.LENGTH_SHORT)
.show()
}
}
})
```
})
```
### 相关字段说明
```java
Expand Down

0 comments on commit c007f69

Please sign in to comment.