Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
シンプルなカスタムアダプターがあります。開始位置を異なる時間に異なる位置に設定する必要があります。標準の listadapter を使用する場合、単純に myCursor.moveToPosition( i ) を使用できます。getview を使用するカスタム アダプタは、そのようには機能しません。現在のリストを希望の位置に移動する方法を教えてもらえますか?
ListView が利用可能な場合は、次を使用します。getListView().setSelection( i );
getListView().setSelection( i );
(または myListView.setSelection(i);)
myListView.setSelection(i);
以下を使用して、現在の位置を取得することもできます(おそらく onResume で戻るため)。
int myPosition = getListView().getFirstVisiblePosition();