Android Open Source - AerisAndroidLibrary Recent Obs Fragment

From Project

Back to project page AerisAndroidLibrary.


The source code is released under:

Apache License

If you think the Android project AerisAndroidLibrary listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.fragment;
//w  ww  .  j a  v  a2  s. co  m
import java.util.List;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.example.demoaerisproject.R;
import com.example.listview.ObservationPeriodAdapter;
import com.hamweather.aeris.communication.AerisCallback;
import com.hamweather.aeris.communication.EndpointType;
import com.hamweather.aeris.model.AerisResponse;
import com.hamweather.aeris.model.ObservationPeriod;
import com.hamweather.aeris.response.ObRecentResponse;

public class RecentObsFragment extends AerisFragment implements AerisCallback {
  ListView listView;
  ObservationPeriodAdapter adapter;
  private List<ObservationPeriod> periods;

  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_extforecast,
        container, false);
    listView = (ListView) rootView;
    return rootView;

  public void onResult(EndpointType endpoint, AerisResponse response) {
    if (listView == null) {
    if (endpoint == EndpointType.OBSERVATIONS_RECENT) {
      if (response.isSuccessfulWithResponses()) {
        ObRecentResponse fResponse = new ObRecentResponse(
        periods = fResponse.getPeriods();
        if (adapter == null) {
          adapter = new ObservationPeriodAdapter(periods,
        } else {
      } else {

  void performRequest() {

  EndpointType getEndpointType() {
    return EndpointType.OBSERVATIONS_RECENT;

  String getKey() {
    return HeadlessFragment.RECENT_OBS;

Java Source Code List