@Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); Log.d("LoggingService", "onDestroy()"); gps.stopUsingGPS(); gps.stopSelf(); gps = null; lDAO.close(); }
@Override public int onStartCommand(Intent intent, int flags, int startId) { Log.d("LoggingService", "running......"); // gps service 에서 좌표 수집 lat = gps.getLatitude(); lng = gps.getLongitude(); // Current Time 수집 long now = System.currentTimeMillis(); Date date = new Date(now); SimpleDateFormat CurDateFormat = new SimpleDateFormat("yyyy년 M월 d일"); SimpleDateFormat CurTimeFormat = new SimpleDateFormat("HH시 mm분 ss초"); strCurDate = CurDateFormat.format(date); strCurTime = CurTimeFormat.format(date); Log.d("address", "현재시각 :" + strCurDate + " " + strCurTime); // 날씨정보 수집 new WeatherLoadingTask().execute(null, null); return START_NOT_STICKY; }