kopia lustrzana https://github.com/ge0rg/aprsdroid
storage: obtain call from a random cursor
rodzic
365c1258c7
commit
2d43b6fb58
|
@ -85,6 +85,19 @@ object StorageDatabase {
|
|||
}
|
||||
singleton
|
||||
}
|
||||
|
||||
def cursor2call(c : Cursor) : String = {
|
||||
val msgidx = c.getColumnIndex(Post.MESSAGE)
|
||||
val callidx = c.getColumnIndex(Position.CALL)
|
||||
if (msgidx != -1 && callidx == -1) { // Post table
|
||||
val t = c.getInt(Post.COLUMN_TYPE)
|
||||
if (t == Post.TYPE_POST || t == Post.TYPE_INCMG)
|
||||
c.getString(msgidx).split(">")(0)
|
||||
else
|
||||
null
|
||||
} else
|
||||
c.getString(Position.COLUMN_CALL)
|
||||
}
|
||||
}
|
||||
|
||||
class StorageDatabase(context : Context) extends
|
||||
|
|
Ładowanie…
Reference in New Issue