我需要添加一個字母「S」在一個EditText(OE)最後寫入數之後這樣:添加一個字符一個EditText
如果我寫我號碼:「123」,它必須發送「 123S「代替。如果我寫「1234」,它必須發送「1234S」。
如何做到這一點?
我的代碼:
((Button) findViewById(R.id.btn_write_HRM_Noty)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
str = Oe.getText().toString();
str = str.substring(0, 0) + "G" + str.substring(0, str.length());
mService.enableHRNotification(mDevice, str);
}
});