[mono-android] binding android library porject to xamarin android

venkatesh venkatesh.r at sierratec.com
Thu Dec 5 11:41:38 UTC 2013


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
<http://mono-for-android.1047100.n5.nabble.com/file/n5713632/api.xml>  
generated class file    : 
Com.Costum.Android.Widget.PullToRefreshListView.cs
<http://mono-for-android.1047100.n5.nabble.com/file/n5713632/Com.Costum.Android.Widget.PullToRefreshListView.cs>  


Please guide me on the above issue.

Thanks



--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/binding-android-library-porject-to-xamarin-android-tp5713632.html
Sent from the Mono for Android mailing list archive at Nabble.com.


More information about the Monodroid mailing list