This question has already been answered:
Hello.
It is necessary to transfer the data received via UART to the Activity. This can be done by creating a stream in the Activity in which to organize a while (!isInterrupted()) and read data from the UART buffer. After that, by calling the UI thread Activity - MainActivity.this.runOnUiThread(new Runnable() , perform the necessary actions with this Activity. But if we call other Activities from the main Activity, then the organized stream does not allow to transfer data to the newly created Activity. If I I understand correctly, in order for the data from the stream to be transferred to any Activity, the stream must be created not in the Activity, but in the Service.
Question: did the UART send data, in the stream (which is created in Servce) you need to transfer data to the Activity, which is now active, how can this be done and is it done in general?