I’m developing an Android language dictionary app. I’m thinking of a Favourites button that works in two phases:
- a short click will add the currently viewed word into the Favourites list;
- and a long click will allow user to view the Favourites list (of added words).
I wonder if this is possible, and if yes could you please explain how to do it?
NB: Till now I’ve only succeeded in adding a Favourites image button to the app, and when short-clicked, it says: “Chosen Word Added to Favourites”.
Thank you very much in advance.
Assuming, say,
public class FavViewActivity extends ListActivity, you just add the OnLongClickListener the same way as you added the OnClickListener:In your db, keep a favourite table listing the id:s of the words that are marked as favourites.
For creating a new Activity, like FavViewActivity, there are plenty of guides around.
For more help, please be more specific about what, and also add what you have tried so far. ^_^