Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/210.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在CustomAdapter中使用SimpleCorsorAdapter和ArrayAdapter_Android_Android Listview_Android Arrayadapter_Simplecursoradapter_Custom Adapter - Fatal编程技术网

Android 在CustomAdapter中使用SimpleCorsorAdapter和ArrayAdapter

Android 在CustomAdapter中使用SimpleCorsorAdapter和ArrayAdapter,android,android-listview,android-arrayadapter,simplecursoradapter,custom-adapter,Android,Android Listview,Android Arrayadapter,Simplecursoradapter,Custom Adapter,我有一个列表视图,其中的前5个元素将由从strings.xml中定义的数组中检索的元素填充。这些是静态的,永远不会改变。其余元素将从SQLite数据库中填充。这些是动态的,用户可以从中删除和添加 是否有一种方法可以实现一个自定义适配器,在这里我可以使用ArrayAdapter和SimpleCorsorAdapter的组合 我尝试在网上搜索这样的组合,但找不到任何有帮助的。非常感谢您的帮助。为什么您不能通过从db检索数据到数组来尝试仅使用ArrayAdapter创建一个公共ArrayList,将A

我有一个
列表视图
,其中的前5个元素将由从strings.xml中定义的数组中检索的元素填充。这些是静态的,永远不会改变。其余元素将从SQLite数据库中填充。这些是动态的,用户可以从中删除和添加

是否有一种方法可以实现一个自定义适配器,在这里我可以使用
ArrayAdapter
SimpleCorsorAdapter
的组合


我尝试在网上搜索这样的组合,但找不到任何有帮助的。非常感谢您的帮助。

为什么您不能通过从db检索数据到数组来尝试仅使用ArrayAdapter创建一个公共ArrayList,将ArrayAdapter数据和SimpleCursorAdapter数据组合在一起,并使用单个ArrayAdapter创建一个新的ArrayList,其中包含string.xml中的值,然后从数据库将该列表传递到listview adapterYes@john还有普拉文。我能做到。但是我必须实现自己的加载器来管理动态数据,如果可能的话,我希望避免这种情况。