From c007f69fce3281f22ab6e625667bc148fe6ece98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E5=88=A9=E5=85=B5?= <3214341986@qq.com> Date: Sun, 4 Aug 2024 20:09:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0README=E4=BB=A5=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=E4=BE=9D=E8=B5=96=E9=A1=B9=E6=B7=BB=E5=8A=A0=E7=9A=84?= =?UTF-8?q?=E6=AD=A3=E7=A1=AEgradle=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index babc357..8df3a3a 100644 --- a/README.md +++ b/README.md @@ -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