I've followed the try/finally approach but still get this error.

Is there anything else that can be done?

Here is what I have.

MediaDbAdapter mDbHelper = null;
Cursor c = null;
try {
        mDbHelper = new MediaDbAdapter(ctxt);
        mDbHelper.open();
        c = mDbHelper.findByX(data.getX());
        if(c != null) {
           //Do an Update on the database
        }
        else if(c == null) {
          //Do an Insert on the database
        }
} finally {
                        if(c != null) {
                                c.deactivate();
                                c.close();
                                c = null;
                        }
                        if(mDbHelper != null && mDbHelper.isOpen()) {
                                mDbHelper.close();
                        }
                }

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

Reply via email to