コード例 #1
0
  @Override
  protected VendorListResponse doInBackground(String... params) {
    if (params.length != 0) return null;

    try {
      VendorListResponse myVendors = myApp.getBudgetOnlineService().getVendors(myApp.getSession());
      Integer rt = myVendors.getReturnCode();
      // Log.d("INFO", "Returncode: " + rt.toString());
      return myVendors;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
コード例 #2
0
  @Override
  protected void onPostExecute(VendorListResponse result) {
    int duration = Toast.LENGTH_SHORT;
    if (result != null) {
      // erfolgreich eingeloggt
      if (result.getReturnCode() == 200 || result.getReturnCode() == 404) {

        myApp.setVendors(result.getVendorList());
        myApp.increaseInitialDataCounter();
        Log.d("INFO", "Händlerliste erfolgreich angelegt.");
        listener.onTaskCompleted(true);
      }
    } else {
      Log.d("INFO", "Händler konnten nicht geladen werden.");
      listener.onTaskCompleted(false);
    }
  }