private void getDataFromCache() { infors = mClient.selectAll(); layout.setVisibility(View.VISIBLE); progressBar.setVisibility(View.GONE); adapter = new ProjectAccountAdapter(mContext, this.infors); adapter.setEmptyString(getEmptyString()); mListView.setAdapter(adapter); }
@Override protected void callAfterDataBack(int TaskID) { switch (TaskID) { case TaskConstant.GET_ACCOUNT_DETAIL: progressBar.setVisibility(View.GONE); layout.setVisibility(View.VISIBLE); break; } }
@Override protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_projectaccount); super.onCreate(savedInstanceState); mClient = ProjectAccount_DBClient.get(mContext); if (!mClient.isEmpty()) getDataFromCache(); else { if (hasNetWork()) getInfor(0, "刷新"); else { layout.setVisibility(View.VISIBLE); progressBar.setVisibility(View.GONE); adapter = new ProjectAccountAdapter(mContext, this.infors); adapter.setEmptyString(getEmptyString()); mListView.setAdapter(adapter); XtomToastUtil.showShortToast(mContext, R.string.nonetwork); return; } } }
private void getDataFromCache() { infor = mClient.selectByPid(pid); layout.setVisibility(View.VISIBLE); progressBar.setVisibility(View.GONE); managedata(); }