Outputstream still saves old data
I have an application in which I can receive bluetooth messages, but whenever I write a message it will still remember data from the previous message. How do I clear this? Underneath is my code for sending the message:
private fun sendMessage(message: String) {
messages.add(message)
val time = SimpleDateFormat("HH
mmss").format(Date())
messageAdapter?.add(
"$message\n\t${bluetoothAdapter?.name} $time"
)...