我在将数据从 移动Cursor
到 时遇到了麻烦PageFragment
。我从 中读取所有数据Cursor
,但PageFragment
只有最后一个值。所以位置继续(0,1,2,..),但从光标开始它只到最后一个。
我怎么解决这个问题?
请帮忙!
public android.support.v4.app.Fragment getItem(int position) {
while (cursor.moveToNext()){
GlobalVars.ditty = cursor.getString(cursor.getColumnIndex(DB.COLUMN_DIT));
}
return PageFragment.newInstance(position, GlobalVars.ditty);
}
public static class GlobalVars {
public static String ditty;
}