i am currently working on a maths application.I want to add a favourite button through which the user can add it to the favourite list.Till now i have added the favourite button but how to add the activity to the favourites when a user clicks it.can anybody tell me???
Sounds like you're trying to create a list of the user's favorite Activities in a String list? To do this...
get the name of the Activity using String mActivityName = this.getClass().getSimpleName();
create an ArrayList using ArrayList mFavList;
which will collect the Activity names.
Set an OnClickListener on the button which will add the Activity name to the ArrayList mFavList.add(mActivityName)