相关疑难解决方法(0)

使用simpleCursorAdapter插入新记录后更新listview-requery()

我了解requery()机制,但我不了解实施:

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        datasource = new pollDataSource(this);
        datasource.open();

        Cursor values = datasource.getAllCategorie();

        String[] categorieColumns =
            {
                MySQLiteHelper.COLUMN_NOME   // Contract class constant containing the word column name

            };


            int[] mWordListItems = { R.id.categoria_label };


        SimpleCursorAdapter adapter = new SimpleCursorAdapter(
                getApplicationContext(),               // The application's Context object
                R.layout.single_list_item,             // A layout in XML for one row in the ListView
                values,                                // The result from the query
                categorieColumns,                      // A string array of column names in the …
Run Code Online (Sandbox Code Playgroud)

sqlite android listview

1
推荐指数
1
解决办法
2942
查看次数

标签 统计

android ×1

listview ×1

sqlite ×1