字符串参数特殊字符的转义

main
Matthew 12 months ago
parent 6b61dcbc95
commit db5b80926d

@ -437,6 +437,9 @@ public class DeviceActivity extends AppCompatActivity {
leftTopOsd += simpleDateFormat2.format(dt) + " ";
leftTopOsd += "CH:" + Integer.toString(channel) + " ";
leftTopOsd = leftTopOsd.replaceAll("\\\\", "\\\\\\\\");
leftTopOsd = leftTopOsd.replaceAll(" ", "\\\\ ");
String usb = (channel == 4) ? "true" : "false";
JSONObject channelJson = (JSONObject) mChannelCfgs.get(Integer.valueOf(channel));
if (channelJson != null) {

Loading…
Cancel
Save