Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing the View.IOnTouchListener interface

In Xamarin, I have coded a class that implements the View.IOnTouchListener interface.

Here is my code:

public class OnTouchListener : View.IOnTouchListener
{
    public bool OnTouch (View v, MotionEvent e)
    {
        return true;
    }

    void IDisposable.Dispose ()
    {
        throw new NotImplementedException ();
    }

    IntPtr Android.Runtime.IJavaObject.Handle {
        get {
            throw new NotImplementedException ();
        }
    }
}

What values do I need for the IDisposable.Dispose and Android.Runtime.IJavaObject.Handle code items, rather than the throw new NotImplementedException () code?

Thanks in advance

like image 234
user3736648 Avatar asked Jul 01 '14 05:07

user3736648


People also ask

How do I create an interface view?

To create an interface view, click Interface on the File > New menu, or right-click on the Server Explorer and click Interface on the New menu. The definition of the interface will be populated with the fields of the selected view. The Interface View wizard has three tabs: Definition: in this tab you can configure the definition of the view:

What are interface views in Java?

Interface views are a special type of views that consist only of a definition of fields and a reference to another view. You can use them to do top-down design where you first define the fields of the interface and at a later stage, associate the “implementation view” of the interface.

What is the difference between implementation view and interface view?

The fields of the interface views do not have their own “Source type properties”. At runtime, Virtual DataPort propagates these properties from the implementation view to the interface view. Thus if the implementation view changes, the properties of the fields of the interface view will change as well.

What operations can be executed on an interface view?

Therefore, the operations that can be executed on an interface view ( SELECT, INSERT, UPDATE or DELETE) are the same that can be performed on its implementation view. The status of an interface view can be: Ok: all the fields of the interface view have a valid “implementation expression”. The queries involving this view will work.


1 Answers

You should inherit Java.Lang.Object in your OnTouchListener like this

public class OnTouchListener : Java.Lang.Object,  View.IOnTouchListener

it will implement Handle and Dispose

you should do this whenever implement any Java interface

like image 81
xakpc Avatar answered Oct 25 '22 18:10

xakpc