| | |
| | | import android.graphics.Bitmap; |
| | | import android.graphics.Color; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.net.Uri; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | |
| | |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.widget.FlashingBoxDialog; |
| | | import com.hdl.photovoltaic.widget.FlashingIconBoxDialog; |
| | | import com.hdl.photovoltaic.widget.apkwgtupload.ApkDownLoadService; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.UpdateConfirmationCancelDialog; |
| | | |
| | |
| | | |
| | | private void initView() { |
| | | viewBinding.toolbarTopRl.topBarView.setBackgroundColor(getColor(R.color.text_00000000)); |
| | | viewBinding.asRegardsVersionUpdatingRl.setVisibility(View.GONE); |
| | | viewBinding.toolbarTopRl.topTitleTv.setText(R.string.me_regard); |
| | | viewBinding.toolbarTopRl.topBackLl.setVisibility(View.VISIBLE); |
| | | String versionsStr = _mActivity.getResources().getString(R.string.app_version_number) + " " + AppConfigManage.getVersionName(); |
| | |
| | | updateConfirmationCancelDialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { |
| | | @Override |
| | | public void Confirm() { |
| | | Intent intent = new Intent(_mActivity, ApkDownLoadService.class); |
| | | intent.putExtra("updateUrl", mNewVersionBean.getPackageUrl()); |
| | | intent.putExtra("downLoadName", HdlAppUpdateLogic.getInstance().getApkFileName()); |
| | | intent.putExtra("downLoadType", "0"); |
| | | _mActivity.startService(intent); |
| | | FlashingBoxDialog flashingBoxDialog = new FlashingBoxDialog(_mActivity, 1500); |
| | | flashingBoxDialog.setContent(getString(R.string.loading_not_supported)); |
| | | flashingBoxDialog.show(); |
| | | // try { |
| | | // PackageManager packageManager = getPackageManager(); |
| | | // PackageInfo packageInfo = packageManager.getPackageInfo("com.android.vending", 0); |
| | | // String versionName = packageInfo.versionName; // 获取版本号 |
| | | // int versionCode = packageInfo.versionCode; // 获取版本代码 |
| | | // // 在此处处理版本信息 |
| | | // } catch (PackageManager.NameNotFoundException e) { |
| | | // e.printStackTrace(); |
| | | // // 处理异常,例如谷歌Play商店应用未安装 |
| | | // } |
| | | // |
| | | // String packageName = "com.hdl.photovoltaic"; // 替换为你想跳转到的应用的包名 |
| | | // Intent intent = new Intent(Intent.ACTION_VIEW); |
| | | // intent.setData(Uri.parse("market://details?id=" + packageName)); |
| | | // startActivity(intent); |
| | | updateConfirmationCancelDialog.dismiss(); |
| | | |
| | | } |