Apps Dynamically change context menu, NOOB here!!


I am new in android developing and i'm facing a problem in changing dynamically the context menu options.

I have a listview and i would like the context menu options change depending on which listitem i long-pressed. I just dont know how to dynamically change the context menu options.

As far as i know there is the onPrepareOptionMenu() function...but i dont know how to use it

Any help would be appreciated