use of com.xiecc.seeWeather.modules.about.domain.Version in project SeeWeather by xcc3641.
the class VersionUtil method showUpdateDialog.
private static void showUpdateDialog(Version versionAPI, final Context context) {
String title = "发现新版" + versionAPI.name + "版本号:" + versionAPI.versionShort;
new AlertDialog.Builder(context).setTitle(title).setMessage(versionAPI.changelog).setPositiveButton("下载", (dialog, which) -> {
Uri uri = Uri.parse(versionAPI.updateUrl);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(uri);
context.startActivity(intent);
}).setNegativeButton("跳过此版本", (dialog, which) -> SharedPreferenceUtil.getInstance().putString("version", versionAPI.versionShort)).show();
}
Aggregations