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