我的fragments
中有View pager
,这是getItem
方法:
@Override
public Fragment getItem(int position) {
fragmentPosition = position;
Log.e("PageAdapter", "Creating fragment at: " + position);
DefinedValues.thumbnailInfo.put("activity", DefinedValues.images);
DefinedValues.thumbnailInfo.put("type", "info");
DefinedValues.thumbnailInfo.put("page", position+ 1 + "");
String request = Json.stringToJson(DefinedValues.thumbnailInfo);
DefinedValues.thumbnailInfo.clear();
StringAsyncRetriever net = new StringAsyncRetriever();
net.setListener(MyPagerAdapter.this);
net.execute(request, DefinedValues.GET_DATA);
Log.d(TAG, "got item @ " + position);
myFragment = new fragment1();
myFragment.position = position;
return myFragment;
//return null;
}
是否可以仅在asyncTask
完成而不冻结线程时返回?