如何使用 Android 导航将长值传递到目标片段?

How to pass a long value to a destination fragment using Android Navigation?

我想为 Android 导航实现 safe-args plugin

这适用于整数和字符串,但我无法长时间获取生成的代码。

这可能吗?

我试过:

<fragment
    android:id="@+id/myFragment"
    android:name="com.x.app.y.MyFragment"
    android:label="fragment_mine"
    tools:layout="@layout/fragment_mine">
    <argument
        android:name="row_id"
        app:type="long"/>
</fragment>

但这会生成字符串代码。

这是我的选择:

行为如下:

UI 中的类型列表是导航安全参数当前支持的完整值列表,因此当前 1.0.0-alpha01 版本不支持长整数。

有一个 existing feature request 可以添加其他支持的类型,long 是请求的类型之一。