On Jul 19, 2012, at 9:32 PM, DFX wrote:
> When I change the Application to use a target API level of 12, 14, or 15, I
> get a build error in the Application project. The error is:
> Cursor is not abstract and does not override abstract method
> getType(int) in android.database.Cursor.
Is Cursor located in your Application project or your Library project?
The problem is that Java and C# don't fully match up semantically; in this
case, Java allows interfaces to change over time, while C# requires that they
never change. Guess what ICursor.GetType(int) is?
http://androidapi.xamarin.com/?link=M%3aAndroid.Database.ICursor.GetType(System.Int32)
It's a method added to API 11. ICursor is in API 1. :-)
So, Java is (rightfully!) complaining that your TargetFrameworkVersion is
Android 3.1 (API 12), which has a Cursor.getType() interface method, but your
Cursor implementation doesn't implement the ICursor.GetType() method.
The fix? Implement that method.
I suspect that your Cursor implementation is in your Library project, which is
set for a TargetFrameworkVersion <= API 10, so it doesn't "see"
ICursor.GetType(int). Consequently the IL doesn't implement
ICursor.GetType(int), and thus when your Application generates Android Callable
Wrappers there is no Cursor.GetType() method to generate.
The fix? Ensure that your Library project targets the same
TargetFrameworkVersion as your Application project.
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid