| | |
| | | @Override |
| | | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | |
| | | // 弹窗 |
| | | |
| | | if (Build.VERSION.SDK_INT >= 26) { |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.REQUEST_INSTALL_PACKAGES}, INSTALL_PACKAGES_REQUESTCODE); |
| | | } else { |
| | |
| | | private void showDialog() { |
| | | AlertDialog.Builder builder = new AlertDialog.Builder(this); |
| | | builder.setTitle(R.string.app_name); |
| | | builder.setMessage(HDLApp.getInstance().getResources().getString(R.string.app_update_content)); |
| | | builder.setPositiveButton(HDLApp.getInstance().getResources().getString(R.string.me_set), new DialogInterface.OnClickListener() { |
| | | builder.setMessage(HDLApp.getInstance().getAppLocaleContext().getString(R.string.app_update_content)); |
| | | builder.setPositiveButton(HDLApp.getInstance().getAppLocaleContext().getString(R.string.me_set), new DialogInterface.OnClickListener() { |
| | | @RequiresApi(api = Build.VERSION_CODES.O) |
| | | @Override |
| | | public void onClick(DialogInterface dialogInterface, int i) { |
| | |
| | | mAlertDialog.dismiss(); |
| | | } |
| | | }); |
| | | builder.setNegativeButton(HDLApp.getInstance().getResources().getString(R.string.loading_cancel), new DialogInterface.OnClickListener() { |
| | | builder.setNegativeButton(HDLApp.getInstance().getAppLocaleContext().getString(R.string.loading_cancel), new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialogInterface, int i) { |
| | | if (sListener != null) { |