Home > Mobile >  Android in the process of sending data flash back
Android in the process of sending data flash back

Time:12-08

Bluetooth to send data, sending 64 bytes at a time, and then receive a return value, according to the return value to send a set of data, most probably to send twenty thousand bytes, there will be a flash back phenomenon, send less than ten thousand sometimes flash back, flash back time is different also, define dataByte is 1024

CodePudding user response:

You send in the main thread is not going to be?

CodePudding user response:

reference 1st floor can't write code monkey reply:
you send in the main thread is not?


I am useless thread to send data, click the button after invoke this method directly

CodePudding user response:

refer to the second floor chrisjuly response:
Quote: refer to 1st floor can't write code monkey reply:
you send in the main thread is not?


I useless thread to send data, click the button to invoke this method directly after


Flash back just good, that's not time-consuming operation, will be implemented in the child thread, otherwise it will cause the main thread to block,

CodePudding user response:

Don't directly to the new Thread, can lead to memory leaks, look at this article https://blog.csdn.net/w366549434/article/details/106898866/, it is best to read the post crash log
  • Related