I want to specify a wildcard for Generics in DataBinding on Android.

Asked 1 months ago, Updated 1 months ago, 1 views

When I use DataBinding on Android, I would like to specify a wildcard as follows. Is it possible?
A build error will occur if the following is written:
Is there any solution?

<data>
      <import type="java.util.List"/>
      <variable name="userList" type="List&lt;?>"/>
    </data>

android

2022-09-30 14:10

1 Answers

DataBinding requires a HTML escape to write in XML.Therefore,

<data>
  <import type="java.util.List"/>
  <variable name="userList" type="List&lt;?&gt;"/>
</data>

must be described as


2022-09-30 14:10

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.