問題タブ [mutablelivedata]

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

sqlite - その文字列 [] がフィールドの場合、文字列 [] 内の位置による SQLite ソート

Room に以下のようなテーブルがあり、Android アプリケーションで Raw Query を使用してデータを取得します。配列sorting_fieldの2 番目の値でソートできますか?

最初に、関数内で Transformations.switchMap を使用してリポジトリで並べ替えの部分を行い、MutableLiveData> を適用し、Collections.sort を適用しました。

それは魅力のように働きました:

ページングの実装後、ソート ロジックを削除し、クエリ ビルダーに移行して、現在に至ります。