Java – Android coding problem

I have the following lines:

String textEncoding = ((payload[0] & 128) == 0) ? "UTF-8" : "UTF-16";

Both "UTF-8" and "utf-16" are red, indicating the error of "unable to parse symbols"

I don't know what to do. I'm a novice to Android. I'm not sure if there are any specific things I need to do to make Android studio recognize what they are. Thank you very much

Editing: previous jobs

byte[] payload = record.getPayload();

        // Get the Text Encoding
        String textEncoding = ((payload[0] & 128) == 0) ? "UTF-8" : "UTF-16";

resolvent:

Make sure there are no non terminated string constants, i.e. unpaired, before this allocation. For example, the following will reproduce your problem:

"String textEncoding = ((payload[0] & 128) == 0) ? "UTF-8" : "UTF-16";

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>