示例#1
0
 @Override
 protected List<HotelRoom> doInBackground(final Void... voids) {
   try {
     final RoomAvailabilityRequest request =
         new RoomAvailabilityRequest(hotelId, SampleApp.occupancy(), arrivalDate, departureDate);
     return RequestProcessor.run(request);
   } catch (EanWsError ewe) {
     Log.d(SampleConstants.LOG_TAG, "An error occurred in the api", ewe);
   } catch (UrlRedirectionException ure) {
     SampleApp.sendRedirectionToast(getApplicationContext());
   }
   return null;
 }
示例#2
0
 @Override
 protected com.ean.mobile.hotel.HotelInformation doInBackground(final Void... voids) {
   try {
     return RequestProcessor.run(new InformationRequest(hotelId));
   } catch (EanWsError ewe) {
     Log.d(SampleConstants.LOG_TAG, "Unexpected error occurred within the api", ewe);
   } catch (UrlRedirectionException ure) {
     SampleApp.sendRedirectionToast(getApplicationContext());
   }
   return null;
 }
示例#3
0
  /** {@inheritDoc} */
  @Override
  public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.reservationdisplay);

    final Reservation reservationToDisplay = SampleApp.getLatestReservation();

    final TableLayout infoList = (TableLayout) findViewById(R.id.reservationInfoList);

    final ViewAdder adder = new ViewAdder(infoList, getLayoutInflater(), getApplicationContext());

    adder.addKeyValue(R.string.itinerary_id, reservationToDisplay.itineraryId);
    adder.addKeyValue(
        R.string.confirmation_numbers,
        TextUtils.join(",", reservationToDisplay.confirmationNumbers));
    adder.addKeyValue(R.string.checkin_instructions, reservationToDisplay.checkInInstructions);
    adder.addKeyValue(
        R.string.arrival_date, DATE_FORMATTER.print(reservationToDisplay.arrivalDate));
    adder.addKeyValue(
        R.string.departure_date, DATE_FORMATTER.print(reservationToDisplay.departureDate));
    adder.addKeyValue(R.string.hotel_name, reservationToDisplay.hotelName);
    adder.addKeyValue(R.string.hotel_address, reservationToDisplay.hotelAddress.toString());
    adder.addKeyValue(R.string.room_description, reservationToDisplay.roomDescription);
  }