SQLiteOpenHelper
类。通过重写其onCreate()
和onUpgrade()
方法来执行SQL语句。,,``java,public class MyDatabaseHelper extends SQLiteOpenHelper {, private static final String DATABASE_NAME = "mydatabase.db";, private static final int DATABASE_VERSION = 1;,, public MyDatabaseHelper(Context context) {, super(context, DATABASE_NAME, null, DATABASE_VERSION);, },, @Override, public void onCreate(SQLiteDatabase db) {, db.execSQL("CREATE TABLE mytable (id INTEGER PRIMARY KEY, name TEXT)");, },, @Override, public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {, db.execSQL("DROP TABLE IF EXISTS mytable");, onCreate(db);, },},
``Collections.sort()
方法对数据源进行排序,然后调用notifyDataSetChanged()
方法刷新列表视图。,,``java,Collections.sort(dataList, new Comparator() {, @Override, public int compare(MyData o1, MyData o2) {, return o1.getField().compareTo(o2.getField());, },});,adapter.notifyDataSetChanged();,
``virsh list --all
或ps aux | grep kvm
。,2. 对于Windows系统,使用任务管理器查看是否有虚拟机进程或使用PowerShell命令Get-VM
。Powered By Z-BlogPHP 1.7.3