update
This commit is contained in:
parent
1baa779c49
commit
95c4bdaa9d
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@
|
|||||||
/build
|
/build
|
||||||
/captures
|
/captures
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
|
.idea/vcs.xml
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
@ -30,23 +30,19 @@ class MainActivity : Activity() {
|
|||||||
ble?.startScan()
|
ble?.startScan()
|
||||||
}
|
}
|
||||||
|
|
||||||
th = Thread(Runnable { ->
|
th = Thread(Runnable {
|
||||||
{}.run {
|
|
||||||
thrun = true
|
thrun = true
|
||||||
while (thrun) {
|
while (thrun) {
|
||||||
System.out.println("state ===== " + ble?.mState)
|
System.out.println("state ===== " + ble?.mState)
|
||||||
if (ble?.mState == ble?.CONNECTED) {
|
if (ble?.mState == ble?.CONNECTED) {
|
||||||
uiHandler.post {
|
uiHandler.post {
|
||||||
run {
|
|
||||||
btn.isEnabled = true
|
btn.isEnabled = true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
thrun = false
|
thrun = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
Thread.sleep(200)
|
Thread.sleep(200)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
th?.start()
|
th?.start()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user