ilhamsuaib / Android-Print-Bluetooth

Sample print android to thermal printer created with java(master) and kotlin(kotlin)
22 stars 17 forks source link

second time connection problem #8

Open yunuskarakaya opened 4 years ago

yunuskarakaya commented 4 years ago

firstly thanks for this, my device connect firstly successful but I go back activity and reopen activity, connection device not successful. I read stackOverflow post. In this question, mentioned for about my problem. Because you do not use socket and outputStream and device connection not properly closed. Can you solve this problem ? Thanks..

Mfdsix commented 4 years ago

i solve this by stored value of printer connection status to shared preferences. when connected i change status to 1 / true, and if disconnected / first app launch i set status to 0 / false. so when status is 1, just do print functiion