Parse(byte[]) 不能应用于 java.lang.string



尝试解析数据以在设备和测试服务器之间建立连接。 除了,我在String parsedMessage = (String)comm.parse(toParse).getPayload();(toParse)上得到一条红线

,错误parse(byte[]) in Communicator cannot be applied to (java.lang.String)

我试图将String toParse更改为byte[] toParse,它使红线消失了parse(toParse)byte[] toParse变为红色,并显示错误"所需的字节[],找到java.lang.String">

Communicator comm = new 
Communicatior(InstrumentationRegistry.getTargetContext());
String toParse = "88819188181A7";
String parsedMessage = (String)comm.parse(toParse).getPayload();

尝试像这样调用方法getBytes((:

String parsedMessage = (String)comm.parse(toParse.getBytes()).getPayload();

最新更新