| | |
| | | import android.widget.EditText; |
| | | |
| | | import com.dayu.recharge.databinding.ActivityRechargeBinding; |
| | | import com.dayu.recharge.utils.DeviceNumberUtils; |
| | | import com.dayu.recharge.utils.ToastUtil; |
| | | import com.dayu.recharge.utils.WSHelper; |
| | | import com.tencent.bugly.crashreport.CrashReport; |
| | |
| | | public void onClick(View v) { |
| | | String morny = binding.rechargeWater.getText().toString(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | String initCode = WSHelper.getInstance(RechargeActivity.this).get("initCode", ""); |
| | | String initCode = DeviceNumberUtils.getDeviceNumber(); |
| | | if (TextUtils.isEmpty(initCode)) { |
| | | ToastUtil.show(RechargeActivity.this, "设备注册号为空,请先设置IP和管理员地址"); |
| | | // return; |
| | |
| | | if (s.toString().contains(".")) { |
| | | if (s.length() - 1 - s.toString().indexOf(".") > 2) { |
| | | s = s.toString().subSequence(0, |
| | | s.toString().indexOf(".") + 2); |
| | | s.toString().indexOf(".") + 3); |
| | | editText.setText(s); |
| | | editText.setSelection(s.length()); |
| | | } |