안녕하세요. 아래와 같이 코드를 작성하고 timer 가 실행 -> run 실행 수 빨간색으로 주석처리한 부분에 return -1 을 하고 싶은데요

죽었다깨나도 return 이 안됩니다..

해당 코드가

public int request 라는 함수 안에 있는 코드라서,, timer가 작동이 되면 return -1 을 해서 아예 함수를 나가야 하는데요.

방법을 아시는 분은 답글 부탁드립니다. 

 

 

public int request() {

............

Log.d(TAG, "open Url: " + conn.getURL());
     
     conn.setConnectTimeout(adInfo.getConnectiontimeout());  // 이건 접속 전후 타임아웃 설정인것 같은데..
     conn.setReadTimeout(adInfo.getConnectiontimeout());
 
 
     conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded;charset=UTF-8");
     conn.setRequestProperty("User-Agent", mDeviceInfo.getUserAgent());    
 
     /******* ****************************/ 
              if(mDeviceInfo.mbInter){  // only interstitial
      TimerTask myTask = new TimerTask() {
       public void run() {
        Log.d(TAG, "myTask");
      
        responseCode = HttpURLConnection.HTTP_INTERNAL_ERROR;
        //이 부분

       }
      };
      Timer timer = new Timer();
      timer.schedule(myTask, 3000);  // 5초후 실행하고 종료
 
    
     }
     /**********************************************/
             
      Log.d(TAG, "try getResponseCode.....");
     responseCode = conn.getResponseCode();

}