android - 如何在 API 级别 11 之后用 Cursor 填充 Spinner?

标签 android android-cursor

我在 SO 和其他网站上找到了很多关于如何使用 Cursor 填充 Spinner 的答案,但是他们都使用了已弃用的 SimpleCursorAdapter( Context, int, String[], int[]) 构造函数来做到这一点。似乎没有人描述如何使用 API 级别 11 及更高级别做到这一点。

API 告诉我使用 LoaderManager,但我不确定如何使用它。

最佳答案

No one seems to describe how to do it with API level 11 and above.

文档确实如此,作者 showing you a non-deprecated constructor这与您尝试使用的相同,带有一个 int flags 额外参数。如果没有可用的标志值对您有用,请为标志传递 0

关于android - 如何在 API 级别 11 之后用 Cursor 填充 Spinner?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16414644/

相关文章:

android - React-Native - react-native-update-gradle - 错误

android - Recyclerview,CursorAdapter,中间有 Header View

android - 通过从 RawContacts 中过滤 account_type 列来显示联系人

android - 从android中的电话簿获取联系人号码

android - Cursor.getType 因空结果而引发错误

android - 来自 Inkscape 的图片不适用于 svg-android 库

java - 无法使字段私有(private)最终 java.lang.String java.io.File.path 可访问 Qt Android

android - 无法从 AppWidgetProvider 类中的线程 toast

android - Ionic Android 应用程序在签名版本 apk 上没有互联网访问权限,但调试工作正常

android - 从查找 URI 获取电话号码