Answer the question
In order to leave comments, you need to log in
Displaying a string in a TextView?
Once a second, data arrives via USB
on arrival starts
UsbSerialInterface.UsbReadCallback mCallback = new UsbSerialInterface.UsbReadCallback() {
// Определение метода обратного вызова, который вызывается при приеме данных.
@Override
public void onReceivedData(byte[] arg0) {
// data = null;
try {
data = new String(arg0, "UTF-8");
// data.concat("/n");
runOnUiThread(new Runnable() {
@Override
public void run() {
speed.setText(data);
}
});
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question