2016-01-10 26 views

回答

1

聲明在retroft接口中的方法如下:

@GET( 「/ V1/USER_INFO /(編號)」)
UserSummaryResponse getSummary(@Path( 「ID」) 字符串UID) ;

您需要在您的網絡請求調用中啓動一個新線程,並且不要忘記嘗試捕獲。

new Thread(new Runnable() { 
     @Override 
     public void run() { 
     try { 
     GetSummaryResponse summaryResponse = HttpClientManager.getInstance().userInterface.getSummary(uId); 
     userInfo = summaryResponse.userInfo; 
          setupUserInfo(); 
     } catch (Exception e) { 
     withoutException = false; 
     Log.e(getTag(), e.getMessage()); 
     } 

}}).start();