安卓:光标窗口是全 [英] Android: Cursor Window is full

查看:125
本文介绍了安卓:光标窗口是全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

W / CursorWindow(15677):窗口是全:请求的分配2195889   字节,自由空间2096720字节,窗口大小2097152字节

W/CursorWindow(15677): Window is full: requested allocation 2195889 bytes, free space 2096720 bytes, window size 2097152 bytes

我知道有应用程序的内存可供选择:

I know there is app memory avaliable:

D / dalvikvm(15677):GC_FOR_ALLOC释放9K,免费30%17050K / 24291K,暂停45ms

D/dalvikvm(15677): GC_FOR_ALLOC freed 9K, 30% free 17050K/24291K, paused 45ms

因此​​,它纯粹是为了做光标大小的窗口,阅读时 BLOB 字节[]

So its purely to do with the cursor size window, when Reading blob into byte[].

即时通讯使用内置的方法从游标读取斑点。

Im using the built in method to read blobs from a cursor.

    try
    {
        c = rdb.query("Photos", new String[]{"photo"}, "id = ?", new String[]{""+photoID}, null, null, null);
        if(c.moveToFirst())
        {
            byte[] tArray = c.getBlob(c.getColumnIndex("photo")); // THIS LINE ERRORS
        }               
    }catch(Exception e)
    {
        e.printStackTrace();
    }
    c.close();

    return tArray;

有没有解决的办法吗?窗口尺寸似乎仅限于2097152字节。

Is there a way around this? The window size seems to be limited to 2097152 bytes.

推荐答案

看来,解决这个问题的最好办法是存储照片的SD卡,并保存URI在数据库中。

It seems that the best way around this is to store the Photo on the SDCard, and save the URI in the DB.

虽然我想避免这种情况,这不是太糟糕,而且更稳定。

While I wanted to avoid this, it's not too bad, and is much more stable.

这篇关于安卓:光标窗口是全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆