Type cast from Java.Lang.Object to native CLR type in MonoDroid

前端 未结 8 1223
花落未央
花落未央 2021-02-02 13:38

How to cast Java.Lang.Object to some native type?

Example:

ListView adapter contains instances of native type Message. When i am trying to get SelectedItem from

8条回答
  •  無奈伤痛
    2021-02-02 14:00

    For generic collections, the right answer would be to use JavaList, which is a Java.Lang.Object and also implements IList. But it involves more work that's for sure. This is actually just an adapter for Java's ArrayList implementation.

提交回复
热议问题