I want to design a button such that when it is clicked, I get various options, from which I finally select one.
This is the same as using the concept as in text messages. For example: If we press and hold a, then we get various options for the various accents of ‘a’ in small buttons just above/below the button clicked.
How do I implement this in Android? Do I have to use context menus? How do I get the various options in small buttons? For that, will I have to use an OnTouchlistener?
Take a look at KeybordView.java from the 2.2_r1.1 release. That is the class that implements the keyboard handling. Pay special attention to the Handler around line 246 and the openPopupIfRequired method that displays the popup for the key if there is a long press.
Good luck.