我有一个片段,我在其中放置了一个从互联网获取其内容的列表视图,当我单击一行并返回列表视图时,它再次获取数据,但我想保持列表视图的最后状态,我该怎么做?
public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
mRootView = inflater.inflate(R.layout.fragment_list, container, false);
list = (ListView) mRootView.findViewById(R.id.mainList);
footerView = ((LayoutInflater) G.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.listfooter, null, false);
mainInfoList = new ArrayList<MainInfo>();
mainInfoAdapter = new AdapterMainInfo(getActivity(), R.id.mainList, mainInfoList);
list.setAdapter(mainInfoAdapter);
}
...