問題タブ [mergecursor]

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 投票する
1 に答える
255 参照

android - Android の 2 つのテーブルからリストビューに異種データを表示する

まったく関係のないメモとタスクの 2 つのテーブルがあります。結合されたリスト ビューで両方を一緒に表示する必要があります。これを実現するには、リスト アダプターに指定された結合カーソルに、2 つのテーブルの FULL OUTER JOIN が含まれている必要があります。CursorJoiner/MergeCursor のどちらがよいかわかりません。誰かがこれを達成する方法の実例を挙げてもらえますか?

(コンテンツ プロバイダーを変更することはできません。そのため、カーソルを操作する必要があります。)

編集:また、アイテムを組み合わせた形で並べ替えることができる必要があります。メモには件名の列があり、タスクにはタイトルの列があります。両方に基づいて、結合されたカーソルをアルファベット順に並べ替えます。

0 投票する
0 に答える
28 参照

mergecursor - Finding a distinction which row is from which cursor?

I have used MergeCursor in my code, two loaders give two cursors. First one loads all audios from External_Content_Uri and Second one from Internal_Content_Uri.

The Problem is when I merge both these cursors and populate a List with audios, and I intend to play them through mediaplayer. To set the DataSource, I must find a way to know which song was from the external storage and which one was from internal storage.

While I'm populating the List from mergedcursor, is there a way to know whether the current row from cursor is the one from External_Content_Uri or Internal_Content_Uri?

And is it possible to add an additional column to these cursors returned by the loaders in OnLoadFinished()?