Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.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
CursorAdapter bindView方法仅在android 4.3 jellybean中获取更新的光标,但不更新视图_Android_Android Cursoradapter - Fatal编程技术网

CursorAdapter bindView方法仅在android 4.3 jellybean中获取更新的光标,但不更新视图

CursorAdapter bindView方法仅在android 4.3 jellybean中获取更新的光标,但不更新视图,android,android-cursoradapter,Android,Android Cursoradapter,我正在使用加载器管理器从数据库获取本地数据,并试图通过游标适配器在列表视图中显示 My listview包含视频列表,并具有重命名视频后重命名视频的功能 除了android 4.3 jellybean列表项没有用重命名的文本更新外,所有android版本的一切都正常 我的newview和bindview方法如下 public void bindView(View convertView, Context ctx, Cursor cursor) { ViewHolder holder =

我正在使用加载器管理器从数据库获取本地数据,并试图通过游标适配器在列表视图中显示

My listview包含视频列表,并具有重命名视频后重命名视频的功能

除了android 4.3 jellybean列表项没有用重命名的文本更新外,所有android版本的一切都正常

我的newview和bindview方法如下

public void bindView(View convertView, Context ctx, Cursor cursor) {
    ViewHolder holder = (ViewHolder) convertView.getTag();
    final int id = cursor.getInt(ID);
    final float length = (float) (cursor.getLong(LENGTH) / (1024f * 1024f));
    final String name = cursor.getString(NAME);
    final String path = cursor.getString(PATH);
    final long time = cursor.getLong(DOWNLOAD_TIME);

    holder.title.setText(name);
    holder.length.setText(String.format("%.2f", length) + " Mb");
    if (time != -1) {
        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy",
                Locale.ENGLISH);
        String date = formatter.format(new Date(time));
        holder.date.setText(date);
    }
}



@Override
public View newView(Context arg0, Cursor cursor, ViewGroup parent) {
    final View itemLayout = mInflater.inflate(
            R.layout.new_library_downloaded_item, parent, false);
    final ViewHolder holder = new ViewHolder();
    holder.length = (TextView) itemLayout.findViewById(R.id.length);
    holder.title = (TextView) itemLayout.findViewById(R.id.title);
    holder.date = (TextView) itemLayout.findViewById(R.id.date);
    holder.preview = (ImageView) itemLayout.findViewById(R.id.preview);
    holder.play = (ImageButton) itemLayout.findViewById(R.id.playBtn);
    holder.delete = (LinearLayout) itemLayout.findViewById(R.id.delete);
    holder.share = (LinearLayout) itemLayout.findViewById(R.id.share);
    itemLayout.setTag(holder);
    return itemLayout;
}

private class ViewHolder {
    TextView length;
    TextView title;
    TextView date;
    ImageView preview;
    ImageButton play;
    LinearLayout delete;
    LinearLayout share;
}

有人能帮我吗?

太好了,你的问题真的是…?@pskink重命名视频后列表项没有用文本更新你的光标来自哪里?为什么不使用SimpleCursorAdapter呢?我正在使用加载程序管理器,因此在重命名视频后,我调用加载程序管理器的重新启动加载程序方法和加载完成覆盖方法,我将光标与更新的光标交换在这里加载程序管理器调用asyc线程上的所有内容您使用的是什么内容提供程序?定制的?