click event handler in videoView not working

TjerkHamerTjerkHamer USMember
edited December 2014 in Xamarin.Android

Hello,

probably some kind of foolish mistake on my part, but I can't get the click event handler for te videoView working.

    namespace Television
    {
        [Activity (Label = "Video")]            
        public class TelevisionActivity : Activity
        {
            protected override void OnCreate (Bundle bundle)
            {
                base.OnCreate (bundle);

                // Set our view from the "television" layout resource
                SetContentView (Resource.Layout.Television);

                VideoView videoView1 = FindViewById<VideoView> (Resource.Id.videoView1);

                videoView1.SetVideoURI(Android.Net.Uri.Parse(http://192.168.243.35:1935/liveorigin/ned1.stream_360p/playlist.m3u8));
                videoView1.Start ();
            }

            public void showButtons(View v)
            {
                Console.WriteLine("click on videoplayer");
            }
        }
    }

and my xml:

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/frameLayout1">
        <VideoView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/videoView1"
            android:layout_gravity="center"
            android:clickable="true"
            android:onClick="showButtons" />
    </FrameLayout>

I'm trying to get an click to make a button used to switch channels visible, but the click is not ahndled by my function and also including the following code in mijn onCreate function is not working:

videoView1.Click += delegate {
    Console.WriteLine("click on videoplayer");
};

Is there anybody who can help me with this?

Tjerk Hamer

Best Answer

Answers

Sign In or Register to comment.