我想在特定时间(比如每 5 秒)运行一个 android 方法。这是代码,我想按时间间隔运行。
shipDB = this.openOrCreateDatabase("shipDB", SQLiteDatabase.CREATE_IF_NECESSARY, null);
String query = "select *from ShopList";
Cursor c = shipDB.rawQuery(query, null);
c.moveToFirst();
do{
String Item = c.getString(c.getColumnIndex("name"));
/* Add current Entry to results. */
results.add(Item);
}while(c.moveToNext());
this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, results));
我该怎么做??