Пример #1
0
 @Override
 public void run() {
   YahooResult result = new YahooResult();
   DataManager dm = new DataManager();
   Log.d(TAG, "getAdressThreadRun");
   try {
     result = dm.getAdressFromLocation(myLoc);
   } catch (IOException e) {
     e.printStackTrace();
   } catch (JSONException e) {
     e.printStackTrace();
   }
   Log.d(TAG, "Size: " + result.getFound());
   if (result.getFound() > 0) {
     mHandler.post(new myRunnable(result));
   } else {
     mHandler.post(new myRunnable(null));
   }
 }
Пример #2
0
 @Override
 protected AppInfo doInBackground(String... params) {
   isRunning = true;
   AppInfo result = new AppInfo();
   DataManager dm = new DataManager();
   try {
     result = dm.getAppInfo();
   } catch (ClientProtocolException e) {
     result.setFailed(true);
     result.setFailedReason(e.toString());
     e.printStackTrace();
   } catch (JSONException e) {
     result.setFailed(true);
     result.setFailedReason(e.toString());
     e.printStackTrace();
   } catch (IOException e) {
     result.setFailed(true);
     result.setFailedReason(e.toString());
     e.printStackTrace();
   }
   return result;
 }