1

我有fragmentsView 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完成而不冻结线程的情况下返回?

4

0 回答 0