1

Now I'm facing this problem and don't know about a solution yet. The doc on Xamarin is pretty vague to me on this matter. The fact that Java Generics are implemented as type erase which is quite different from .NET's approach also makes the matter quite complex. Could anyone point me to the right direction? It seems that the generic type parameter should implement IJavaObject, but I did this and it does not work in this case.

4

1 回答 1

2

我想我必须自己回答。在联系 Xamarin 之后,如果使用列表来做需要它是 IJavaObject 的事情,您最好使用 JavaList 而不是同样实现 IList 的 List。JavaList 实际上只是 java.util.ArrayList 的一个包装器

于 2012-09-27T03:29:13.267 回答