introduce implicit cast to runnable

itemized2sql
Georg Lukas 2010-08-08 19:23:18 +02:00
rodzic 298ccae7f8
commit 1d4120207b
1 zmienionych plików z 8 dodań i 6 usunięć

Wyświetl plik

@ -17,6 +17,12 @@ object AprsService {
val PACKET = "de.duenndns.aprsdroid.PACKET"
var running = false
implicit def block2runnable(block: => Unit) =
new Runnable() {
def run() { block }
}
}
class AprsService extends Service with LocationListener {
@ -100,9 +106,7 @@ class AprsService extends Service with LocationListener {
locMan.removeUpdates(this);
locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER,
0, 0, this)
handler.postDelayed(new Runnable() {
def run() { speedBearingEnd(true) }
}, 30000)
handler.postDelayed({ speedBearingEnd(true) }, 30000)
}
def speedBearingEnd(post : Boolean) {
@ -204,9 +208,7 @@ class AprsService extends Service with LocationListener {
}
def postSubmit(post : String) {
handler.post(new Runnable() {
def run() { addPost(StorageDatabase.Post.TYPE_INCMG, "incoming", post) }
})
handler.post { addPost(StorageDatabase.Post.TYPE_INCMG, "incoming", post) }
}
}