Hoge[]とかなら使えないんですかね(Listじゃないですが…) https://t.co/cG6wrQX4Uq
— うし (@ushi3_jp) 2019年3月15日
ObjectArrayTypeとputParcelableArray
実装を読んでみるとObjectArrayTypeという型があり、putParcelableArray
とgetParcelableArray
をマッピングしてるぽいことがわかる。
型の末尾の[]をチェック
あとここで、型の末尾に[]
があるかチェックしている。
なのでこんな感じに書けばよい。
<argument android:name="authors" app:argType="jp.dip.sys1.aozora.models.AuthorCard[]" />
AuthorCardはもちろんParcelableでなければならない。
おわりに
うしさんありがとう。
Pass data between destinations | Android Developersには、
You can check Array to indicate that the argument should be an array of the selected Type value.
と書いてあるので、いずれAndroid Studio上でもarrayかどうかのチェックをUIで設定できるようになるはず(canaryだと動いてそう)。