【问题标题】:How to use FirebaseRecyclerAdapter under AndroidX?AndroidX下如何使用FirebaseRecyclerAdapter?
【发布时间】:2018-10-31 19:46:36
【问题描述】:

AndroidX下如何使用FirebaseRecyclerAdapter?

private FirebaseRecyclerAdapter<Game, GameViewHolder> mAdapter;

给出一个错误:

类型参数 'com.name.name.viewholder.GameViewHolder' 不在 它的界限;应该延长 'android.support.v7.widget.recyclerview.viewholder'

xml:

<androidx.recyclerview.widget.RecyclerView
        android:id="@+id/games_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipToPadding="false"
        android:padding="5dp"
        android:scrollbars="vertical"
        tools:listitem="@layout/item_favorite" />

【问题讨论】:

标签: android firebase firebaseui androidx


【解决方案1】:

There's an issue open on the FirebaseUI Github about this.

FirebaseUI 仍然使用支持库,而不是 androidx。根据该问题,您只需添加

就可以了
android.enableJetifier=true

在您的gradle.properties 中。 Android Studio 可能会抱怨类型不兼容,但应用会编译。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-19
    • 1970-01-01
    • 1970-01-01
    • 2019-03-11
    • 1970-01-01
    相关资源
    最近更新 更多