How does Android Volley handle temporarily loss of network connection?

后端 未结 5 1794
野趣味
野趣味 2021-02-08 14:27

If an Android Volley post request fails due to network loss, will Android Volley retry the post after the network connection is restored automatically? Will it fire all of the r

5条回答
  •  迷失自我
    2021-02-08 14:58

    I have this problem since I try to volley request on a method and onErrorResponse method of volley call that method again.example:

         @Override
                public void onErrorResponse(VolleyError volleyError) {
    
                final Handler handler = new Handler();
    
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        sendOTPAgain();//this method call again and again
                    }
                }, 1000);
            }
    

提交回复
热议问题