SimpleCursorAdapter的构造函数被声明为废除,不能用了吗?那该用什么代替呢

jiayangcg 2013-06-21 01:27:08
new一个SimpleCursorAdapter时,eclips给出了如下的警告:The constructor SimpleCursorAdapter(Context, int, Cursor, String[], int[]) is deprecated. 同时代码上被画上了删除线,显示此接口被废除了。那该用什么代替呢?
...全文
1177 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
u010236975 2014-10-07
  • 打赏
  • 举报
回复
引用 4 楼 jiayangcg 的回复:
这种问题本应该通过看文档就可以解决的,以后要注意了!
楼主,能给解释一下simplecursoradapter的构造法中 int flags应该填什么吗? 这类文档能在哪里找到? 谢谢!
jiayangcg 2013-06-24
  • 打赏
  • 举报
回复
这种问题本应该通过看文档就可以解决的,以后要注意了!
飞上云端123 2013-06-21
  • 打赏
  • 举报
回复
楼上分析的很到位。
凉凉二点凉 2013-06-21
  • 打赏
  • 举报
回复
多了这个flags
凉凉二点凉 2013-06-21
  • 打赏
  • 举报
回复

    /**
     * Standard constructor.
     * 
     * @param context The context where the ListView associated with this
     *            SimpleListItemFactory is running
     * @param layout resource identifier of a layout file that defines the views
     *            for this list item. The layout file should include at least
     *            those named views defined in "to"
     * @param c The database cursor.  Can be null if the cursor is not available yet.
     * @param from A list of column names representing the data to bind to the UI.  Can be null 
     *            if the cursor is not available yet.
     * @param to The views that should display column in the "from" parameter.
     *            These should all be TextViews. The first N views in this list
     *            are given the values of the first N columns in the from
     *            parameter.  Can be null if the cursor is not available yet.
     * @param flags Flags used to determine the behavior of the adapter,
     * as per {@link CursorAdapter#CursorAdapter(Context, Cursor, int)}.
     */
    public SimpleCursorAdapter(Context context, int layout, Cursor c, String[] from,
            int[] to, int flags) {
        super(context, layout, c, flags);
        mTo = to;
        mOriginalFrom = from;
        findColumns(c, from);
    }
一、项目简介 本项目(HF24075 SDFeatureRivertraining)是一套以多路 PWM 多彩 LED 灯光控制为核心的固件方案,基于 PADAUK PMS 系列单片机。方案对蓝、青、粉等多色 LED 进行独立 PWM 调光,实现呼吸、渐变、流水等细腻灯光效果,并支持按键切换与传感器交互。其 PWM 调光结构清晰,是学习单片机 PWM、色彩混合与灯光算法的理想范例。 核心应用场景: 1. 氛围灯 / 流水灯产品开发 2. PWM 调光与色彩混合学习 3. 电子类课程设计 / 毕业设计 4. 灯光艺术与 DIY 项目 适配使用场景:学习练手、毕业设计、课程设计、创业售卖、实操实训,突出实用性与可落地性。 二、硬件核心配置 · 主控芯片:PADAUK(应广科技)PMS 系列 8 位 OTP 单片机 · 外接外设: - 多色 LED 灯组(蓝 / 青 / 粉等多路独立 PWM) - 轻触按键(模式切换) - 传感器(交互触发) · 操控设备: - 机身实体按键操控 三、核心功能介绍 1. 多路独立 PWM 调光:蓝、青、粉等 LED 各自独立占空比控制,实现精准亮度; 2. 呼吸 / 渐变 / 流水效果:通过 PWM 变化曲线营造丰富灯光律动; 3. 按键切换模式:轻触在多种灯效间循环切换; 4. 传感器交互:外部传感信号触发或联动灯光变化; 5. 低功耗设计:闲置进入低功耗,按需唤醒。 6. 参数可配:亮灭周期、渐变速度等可调,便于定制。 四、项目优势与亮点 · 灯光细腻:多路独立 PWM,效果远胜简单开关灯。 · 算法清晰:呼吸 / 渐变实现简洁,易于理解与移植。 · 扩展性强:可轻松增加颜色与模式,适配各类灯饰。 ·

80,493

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧