0

我有一个列表视图,里面有 2 个文本视图,由数据库使用简单的光标适配器填充。我想在列表中的每个项目中添加一个图像,其中包含数据库中的相应图像。我已经搜索过这个主题,但还没有找到解决方案。任何帮助将不胜感激

String[] from = new String[]{InventoryDbAdapter.KEY_TITLE, InventoryDbAdapter.KEY_DESCRIPTION};

    // and an array of the fields we want to bind those fields to (in this case just text1)
    int[] to = new int[]{R.id.text1,R.id.text2};

    // Now create a simple cursor adapter and set it to display
    SimpleCursorAdapter inventory = 
        new SimpleCursorAdapter(this, R.layout.row, InventoryCursor, from, to);
    setListAdapter(inventory

谢谢

4

1 回答 1

0

真的吗?因为快速谷歌搜索出现了这个博客条目,我认为这与我用于我的 Android 应用程序的条目相同。

于 2011-03-13T04:39:09.997 回答