:...: :...: :...:
Code:
val t = object:Thread() {
public override fun run() {
while ((!isInterrupted()))
{
try
{
Thread.sleep(2000)
runOnUiThread(object:Runnable {
public override fun run() {
count++
tv1.setText(String.valueOf(count))
}
})
}
catch (e:InterruptedException) {
e.printStackTrace()
}
}
}
}
t.start()
Code:
// try {
//// val myDataBase = this.openOrCreateDatabase("Musicians", Context.MODE_PRIVATE, null)
//// myDataBase.execSQL("CREATE TABLE IF NOT EXISTS musicians (name VARCHAR, age VARCHAR)")
//// http://myDataBase.execSQL("INSERT INTO musicians (name,age) VALUES ('$artName',50)")
////// val sqlString = "INSERT INTO arts (name, image) VALUES (?, 'test2')"
////// val statement = myDataBase.compileStatement(sqlString)
////// statement.clearBindings()
////// statement.bindString(1,artName)
////// http://statement.bindString(2,"3")
////// statement.execute()
//// val values = ContentValues()
//// values.put("name","testx")
//// values.put("age","5")
//// myDataBase.insert("musicians",null,values)
//// }catch (e: Exception){e.printStackTrace()}