問題タブ [android-recyclerview]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
10522 参照

android - ListView と同じように、CursorAdapter を recycleview に設定することはできますか?

sqliteにリンクされたカーソルを使用する必要があるため、プロジェクトでリストビューを置き換えるソリューションを今までグーグルで検索しませんでした。

次の古い方法: listview.setAdapter(cursorAdapter)この方法で、データベース内のデータを処理するカーソルを取得できます。

しかし、現在、recycleview.setAdapter(recycleview.adapter)BaseAdapter を拡張するアダプターを認識しません。

誰でも私に手を差し伸べることができますか?

0 投票する
2 に答える
10056 参照

java - Android RecyclerView LayoutManager 例外

こんにちは、私は新しい問題を抱えていますAndroid Lollipop RecyclerView

次の例外でクラッシュし続けます。

完全なスタック トレースはここにあります

を開始するために使用されるコードRecyclerViewは、チュートリアルとほぼ同じですが、何らかの理由でこれでも問題が発生します。どんな助けでも大歓迎です。

コードは次の場所からアクセスできます: gist hereおよび layout: this gist

views、 またはのいずれでもobjectsないnull

0 投票する
14 に答える
136309 参照

java - Android 5.0 - Add header/footer to a RecyclerView

I spent a moment trying to figure out a way to add a header to a RecyclerView, unsuccessfully.

This is what I got so far:

The LayoutManager seems to be the object handling the disposition of the RecyclerView items. As I couldn't find any addHeaderView(View view) method, I decided to go with the LayoutManager's addView(View view, int position) method and to add my header view in the first position to act as a header.

Aaand this is where things get uglier:

After getting several NullPointerExceptions trying to call the addView(View view) at different moments of the Activity creation (also tried adding the view once everything is set up, even the Adapter's data), I realized I have no idea if this is the right way to do it (and it doesn't look to be).

PS: Also, a solution that could handle the GridLayoutManager in addition to the LinearLayoutManager would be really appreciated!

0 投票する
5 に答える
12414 参照

android - Android L: RecyclerView の高速スクロール

私はRecyclerView自分のアプリケーションで大量のデータを使用しようとしていListViewます.. この回答からのアプローチは、 では機能しましたがListView、 では機能しませんRecyclerViewtrueレイアウトで高速スクロールを設定しRecyclerViewても、まだ機能しません。

RecyclerViewAndroid L の高速スクロールをサポートしていますか? ドキュメントでこれについて何も見つけることができません。