Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

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.