android - 表格布局和游标

标签 android android-cursor android-tablelayout

是否可以通过游标在表格布局中提供行?如果是,如何?

我的光标。

cursor = db.rawQuery("SELECT _id, countryName , capitalName FROM country WHERE countryName LIKE ?",new String[] { "%" });
adapter = new SimpleCursorAdapter(this, R.layout.capital_list_item,cursor, new String[] { "countryName" , "capitalName"},new int[] { R.id.countryName, R.id.capitalName });

最佳答案

简短而甜蜜的,..您不能在 TableLayout 中使用 Cursor Adapter

您只能在 ListView、Spinner 和 GridView 中使用 Cursor Adapter...

关于android - 表格布局和游标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8398473/

相关文章:

android - Eclipse Helios Android模拟器如何运行示例工程

android - 错误 :(23, 20) 无法解析 : com. github.chrisbanes :PhotoView:2. 1

Android 主题不适用于 Activity

android - ContentObserver 和 DatasetObserver 的区别?

java - 如何删除 Cursor (Android SDK) 中的重复行?

android:layout_span 没有在 eclipse 中显示

Android:表格单元格的高度应该得到前一个单元格的高度

android - ListView 背景颜色未更新

android - 向游标适配器android添加额外的元素

Android - 使用现有的 TableRow 布局将 TableRow 动态添加到 TableLayout