I saw an app where if you press the button it would play a ring tone, then if you kept it down, a message boxed came up asking you if you wish to save the sound file. I would like to have my app detect if a button was pressed down for like a couple seconds.
I cannot figure out how to detect if a button was held down for a long time. I tried Googling it, but came up empty.
Apparently you have not read about onLongClickListener huh?
Read the following links:
http://developer.android.com/reference/android/view/View.OnLongClickListener.html
example code:
Also, you may call registerForContextMenu() instead and pass the View you want to set the listener to. Reference
Sample code:
You must write the code to inflate the context menu:
Where the id your_context_menu must be an .xml file created under the Res/Menu/ folder on your project.
Once the menu is inflated, you must also write the code to respond to options being selected.