模拟延时

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();

 

相关文章:

  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2022-02-07
  • 2021-09-18
相关资源
相似解决方案