Need some help for creating favorite and unfavorite button using tiny db database

i was trying to make a wallpaper app and i am stuck on unfavorite button.

Add to Favorite is done, but Unfavorite is giving me trouble, can you look into the blocks and give me some suggestions,

if this option will work then my wallpaper app project is done.

sample apk - WallPocket.apk (5.3 MB)

Block image -

NOTE : favorite and unfavorite buttons are the same, i just changed the name. and global variable imageUrl is also declared so no need to point on that.

Thank You.

a little help will be appreciated.