开发者

Android Sound keeps replaying

开发者 https://www.devze.com 2023-03-20 02:15 出处:网络
I have an ImageView and I would like it to play a sound as you hold the button, so that the sounds loops continually until开发者_Go百科 the user lets go.

I have an ImageView and I would like it to play a sound as you hold the button, so that the sounds loops continually until开发者_Go百科 the user lets go.

I currently have the following code:

ImageView sound1 = (ImageView) findViewById(R.id.horn1);
sound1.setOnClickListener(new View.OnClickListener()
{
    public void onClick(View view)
    {
        horn1.start();
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消