cant delete element in sqlite android
<p>Hello i've been googling a lot today with no luck. The thing is that i'm trying to delete an element from my database but i only get <code>02-24 14:04:32.635: ERROR/AndroidRuntime(8823): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x327de0</code></p>

<p>The table in the database has only one column which is an <code>INTEGER PRIMARY KEY</code> and has a <code>TRIGGER</code> like this </p>

<pre><code>CREATE TRIGGER "FavForeignKey" BEFORE INSERT ON Favorites WHEN (SELECT rowid FROM Sign Where Sign.rowid = NEW.ViewedImage) IS NULL  BEGIN       SELECT RAISE(ROLLBACK, 'insert on table "Favorites" violates foreign key constraint "Sign.rowid"'); END
</code></pre>

<p>i don't know why i'm getting this error, i need some help. </p>

<pre><code>**Here is the query i'm using:**

public void deleteFavorite(int imageId){
        m_db.delete(FAVORITE_TABLE, FAVORITES_COLUMN_VIEWED_IMAGE, new String[]{""+imageId});
    }
</code></pre>

<p><strong>And here's the error stack:</strong></p>

<pre><code>02-24 14:04:32.635: ERROR/AndroidRuntime(8823): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x327de0
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:241)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at android.database.DatabaseUtils.bindObjectToProgram(DatabaseUtils.java:191)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1669)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at com.enea.takk.database.DBManager.deleteFavorite(DBManager.java:161)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at com.enea.takk.views.ShowImage$1.onClick(ShowImage.java:82)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at android.os.Looper.loop(Looper.java:144)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at android.app.ActivityThread.main(ActivityThread.java:4937)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at java.lang.reflect.Method.invokeNative(Native Method)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at java.lang.reflect.Method.invoke(Method.java:521)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>Some help will be appreciated. </p>

<p>Thanks in advance</p>
