我想用特定的时间(比如每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));
我该怎么做?