Arcane Android problem ? :)

2011/4/4 Tobiah <[email protected]>

> On 04/04/2011 10:39 AM, Kostya Vasilyev wrote:
>
>> In your code, you're leaving the cursor open if the query result count
>> is 0. Hence, the leak.
>>
>
> Haha... Thanks.  I always think it's going to be some arcane Android
> problem.  Of course, you were right.  It's fixed now.
>
> Tobiah
>
>
>
>>    I googled for this, and there are lots of hits, but not, as it seems,
>>    for the same reason that I'm getting it.  I made an SQLite db using
>>    DatabaseHelper as outlined in the docs.  I have some convenience
>>    wrappers so that I can do quick one line queries of various types.
>>    For example:
>>
>>    public String atom(String query, String[] args){
>>            Cursor c = db.rawQuery(query, args);
>>            if(c.getCount() == 0){
>>                    return null;
>>            }
>>            c.moveToPosition(0);
>>            String answer = c.getString(0);
>>            c.close();
>>            return answer;
>>    }
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to