模拟延时
private class GetDataTask extends AsyncTask<Void, Void, String[]>{ @Override protectedString[] doInBackground(Void... params) { //Simulates a background job. try{ Thread.sleep(1000); } catch(InterruptedException e) { } return null; } @Override protected voidonPostExecute(String[] result) { //Do some stuff here //Call onRefreshComplete when the list has been refreshed. mPullRefreshScrollView.onRefreshComplete(); super.onPostExecute(result); } } //调用 new GetDataTask().execute();