Quantcast

binding android library project to xamarin android

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

binding android library project to xamarin android

venkatesh
This post was updated on .
Hi,

We have implemented the Pull to refresh and load more android library project into xamarin application.
For this ,
we have created xamarin android binding project using binding mechanism.
Issue:

the below method in android library project is not added in xamarin binding project.

/**
         * Register a callback to be invoked when this list should be refreshed.
         *
         * @param onRefreshListener
         *            The callback to run.
         */
        public void setOnRefreshListener(OnRefreshListener onRefreshListener) {
                mOnRefreshListener = onRefreshListener;
        }

**Java Interface**

/**
         * Interface definition for a callback to be invoked when list should be
         * refreshed.
         */
        public interface OnRefreshListener {
                /**
                 * Called when the list should be refreshed.
                 * <p>
                 * A call to {@link PullToRefreshListView #onRefreshComplete()} is
                 * expected to indicate that the refresh has completed.
                 */
                public void onRefresh();

}




We need to call the above method  called setOnRefreshListener on ListView in xamarin application project.
But we could not able to call setOnRefreshListener in C# code.

//C# implementation on listview

public class ResfreshListener : Java.Lang.Object, PullToRefreshListView.IOnRefreshListener
        {
            public void OnRefresh()
            {
                Log.Info("PullToRefreshListViewDemo", "Test");
            }
        }

listview.**setOnRefreshListener**(new ResfreshListener () )

Error thrown  calling setOnRefreshListener on listview.
**Error:**
are you missing a using directive or an assembly reference?

setOnRefreshListener method is not generated in api.xml file  and class file.


api file                     : api.xml
generated class file    : Com.Costum.Android.Widget.PullToRefreshListView.cs


Please guide me on the above issue.

Thanks
Loading...