How to make so that at a clamping of the button the sound is reproduced, and at release it stopped?

Closed due to the fact that off-topic participants Vladimir Glinskikh , Vladimir Martyanov , username , tutankhamun , aleksandr barakin August 14 '15 at 10:51 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Questionnaires are forbidden on Stack Overflow in Russian . To get an answer, rephrase your question so that it can be given an unambiguously correct answer." - Vladimir Glinskikh, Vladimir Martyanov, username, tutankhamun, aleksandr barakin
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • This is often used in applications, like the sounds of weapons. When the buttons are clamped there, the sound goes until you release it - Imperator

1 answer 1

You here http://developer.android.com/intl/ru/guide/topics/ui/ui-events.html View elements have events for all occasions and you can hang listeners on them.

  • Linking answers are not welcomed by the community, as the information on the link may change and your answer will become useless. Try to specify the information required to answer the question in your message, and the article can be cited as a source of information. - Timofei Bondarev