attempt to acquire a reference on a close SQLiteClosable in android
<p>hi all i am creating database in android ,i insert some randomly generate Integer in to the table and get the row from table which is match to given input. but i get <code>attempt to acquire a reference on a close SQLiteClosable</code>. if i use without where clause it is works. only problem is when i use where clause in query.</p>

<p>my code:</p>

<pre><code>    db = openOrCreateDatabase("TestData.db",  SQLiteDatabase.CREATE_IF_NECESSARY, null);
    db.setVersion(1);
    db.setLocale(Locale.getDefault());
    db.setLockingEnabled(true);
    final String CREATE_TABLE_COUNTRIES ="CREATE TABLE IF NOT EXISTS tbl_countries (id INTEGER);";
    db.execSQL(CREATE_TABLE_COUNTRIES);

    ContentValues values = new ContentValues();
    values.put("id", 1);
    db.insert("tbl_countries", null, values);
    Log.e("sql", "ok");

    b1.setOnClickListener(new View.OnClickListener() 
    {
        public void onClick(View view) 
        {
           String p = et.getText().toString();
           String [] columns=new String[]{"id"};    
           Cursor c=db.query("tbl_countries", columns, "id"+"=?",new String[]{p}, null, null, null);
           c.moveToFirst();
           c.close();
        }
    });

    db.close();
</code></pre>

<p>my log cat information</p>

<pre><code>  05-23 19:02:20.880: ERROR/AndroidRuntime(5533): java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:31)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:56)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1236)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1123)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1081)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1158)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at com.sql.where.main$1.onClick(main.java:63)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.view.View.performClick(View.java:2364)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.view.View.onTouchEvent(View.java:4179)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.widget.TextView.onTouchEvent(TextView.java:6591)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.view.View.dispatchTouchEvent(View.java:3709)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
 05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.os.Handler.dispatchMessage(Handler.java:99)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.os.Looper.loop(Looper.java:123)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at android.app.ActivityThread.main(ActivityThread.java:4363)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at java.lang.reflect.Method.invokeNative(Native Method)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at java.lang.reflect.Method.invoke(Method.java:521)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  05-23 19:02:20.880: ERROR/AndroidRuntime(5533):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>
