我有一个片段:
public class FilmFragment extends BrowseFragment implements LoaderManager.LoaderCallbacks<Object>
在BrowseFragment我添加了几行项目:
private void loadRubricsFilms(List<Rubric> mRubrics, List<Film> mFilms) {
int j = 0;
for (Rubric mRubric : mRubrics) {
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(mCardPresenter);
for (Film mFilm : mFilms) {
if (mFilm.getRubric() == mRubric.getId()) {
listRowAdapter.add(mFilm);
}
}
HeaderItem header = new HeaderItem(j++, mRubric.getTitle());
mRowsAdapter.add(new ListRow(header, listRowAdapter));
}
setAdapter(mRowsAdapter);
}
我安装了OnItemViewSelectedListener监听器:
private final class ItemViewSelectedListener implements OnItemViewSelectedListener {
@Override
public void onItemSelected(Presenter.ViewHolder itemViewHolder, Object item,
RowPresenter.ViewHolder rowViewHolder, Row row) {
}
}
setOnItemViewSelectedListener(new ItemViewSelectedListener());
覆盖方法onItemSelected:
@Override
public void onItemSelected(Presenter.ViewHolder itemViewHolder, Object item,
RowPresenter.ViewHolder rowViewHolder, Row row) {
}
我需要检测何时选择了行中的最后一项。我如何确定它?