How to implement the favorite functionality in the android gridview -


i'm having app, i'm display information in gridview. need add favorite functionality same gridview. please me this. tried googling, no luck.

you can use custom checkbox favorite in gridview items

here code checkbox

  <checkbox         android:id="@+id/checkbox_favorite"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentleft="true"         android:layout_centervertical="true"         android:button="@drawable/customdrawablecheckbox"          android:layout_marginleft="10dp"/> 

here code custom drawable

  <?xml version="1.0" encoding="utf-8"?>  <selector  xmlns:android="http://schemas.android.com/apk/res/android">  <item android:state_checked="false" android:drawable="@drawable/ic_action_favorite" />  <item android:state_checked="true" android:drawable="@drawable/ic_action_favoritecheck" />  <item android:drawable="@drawable/ic_action_favorite" /> 


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -