我有带有自定义光标适配器的列表视图。它包含数百个项目。向下滚动流畅且快速,但向后滚动 - 一直冻结。我不在 UI 线程上加载图像或某些操作。仅从光标中获取少量值并将其设置为文本视图
private class EpisodesAdapter extends CursorAdapter {
LayoutInflater inflater;
public EpisodesAdapter(Context context) {
super(context, null, false);
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View view = inflater.inflate(R.layout.list_item_episode, parent, false);
view.setBackgroundResource(R.drawable.abs__list_selector_holo_light);
return view;
}
@Override
public void bindView(View view, final Context context, final Cursor cursor) {
final String title = cursor.getString(EpisodesQuery.EPISODE_TITLE);
final String episodeId = cursor.getString(EpisodesQuery.EPISODE_ID);
final String time = cursor.getString(EpisodesQuery.EPISODE_PUBLISHED_AT);
final String episodeUrl = cursor.getString(EpisodesQuery.EPISODE_URL);
final int stateId = cursor.getInt(EpisodesQuery.EPISODE_STATE_ID);
((TextView) view.findViewById(R.id.title)).setText(title);
......
}
}
一些想法可能导致这个问题?