kopia lustrzana https://github.com/ge0rg/aprsdroid
optimize db access
rodzic
bd8b30e4ed
commit
041c7c7602
|
@ -113,7 +113,8 @@ class StationOverlay(icons : Drawable) extends ItemizedOverlay[Station](icons) {
|
||||||
}
|
}
|
||||||
|
|
||||||
def loadDb(db : StorageDatabase) {
|
def loadDb(db : StorageDatabase) {
|
||||||
val c = db.getPositions(null, null, "100")
|
stations.clear()
|
||||||
|
val c = db.getPositions(null, null, null)
|
||||||
c.moveToFirst()
|
c.moveToFirst()
|
||||||
while (!c.isAfterLast()) {
|
while (!c.isAfterLast()) {
|
||||||
val call = c.getString(c.getColumnIndexOrThrow(StorageDatabase.Position.CALL))
|
val call = c.getString(c.getColumnIndexOrThrow(StorageDatabase.Position.CALL))
|
||||||
|
@ -125,6 +126,8 @@ class StationOverlay(icons : Drawable) extends ItemizedOverlay[Station](icons) {
|
||||||
c.moveToNext()
|
c.moveToNext()
|
||||||
}
|
}
|
||||||
c.close()
|
c.close()
|
||||||
|
setLastFocusedIndex(-1)
|
||||||
|
populate()
|
||||||
Log.d("StationOverlay", "total %d items".format(size()))
|
Log.d("StationOverlay", "total %d items".format(size()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +136,6 @@ class StationOverlay(icons : Drawable) extends ItemizedOverlay[Station](icons) {
|
||||||
// return
|
// return
|
||||||
//calls.add(sta.getTitle(), true)
|
//calls.add(sta.getTitle(), true)
|
||||||
stations.add(sta)
|
stations.add(sta)
|
||||||
populate()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def addStation(post : String) {
|
def addStation(post : String) {
|
||||||
|
|
Ładowanie…
Reference in New Issue