Forum Xamarin.Android

Creating Buttons Once Press Sounds play


I have a Small Question making a small app, Each Button plats 1 sound.. and i managed to make 1 button play that one sound,, but the second Button i just dont know how to figure it out? any ideas?

using Android.App;
using Android.Widget;
using Android.OS;
using Android.Media;

namespace Alfabet
[Activity(Label = "Alfabet", MainLauncher = true)]
public class MainActivity : Activity
MediaPlayer _player;
Button playButton;
Button Button1;s

    protected override void OnCreate(Bundle savedInstanceState)

        // Set our view from the "main" layout resource

        _player = MediaPlayer.Create(this, Resource.Raw.bell4);
        playButton = FindViewById<Button>(Alfabet.Resource.Id.playButton);
        playButton.Click += PlayButton_Click;
    void PlayButton_Click(object sender, System.EventArgs e)



Best Answer


Sign In or Register to comment.