Android Open Source - AerisAndroidLibrary Ext Forecast 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  w  w .  java  2 s.  c o  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.ForecastAdapter;
import com.hamweather.aeris.communication.EndpointType;
import com.hamweather.aeris.model.AerisResponse;
import com.hamweather.aeris.model.ForecastPeriod;
import com.hamweather.aeris.response.ForecastsResponse;

public class ExtForecastFragment extends AerisFragment {

  ListView listView;
  ForecastAdapter adapter;
  private List<ForecastPeriod> 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.FORECASTS) {
      if (response.isSuccessfulWithResponses()) {
        ForecastsResponse fResponse = new ForecastsResponse(
        periods = fResponse.getPeriods();
        if (adapter == null) {
          adapter = new ForecastAdapter(periods, getActivity());
        } else {
      } else {

  void performRequest() {

  EndpointType getEndpointType() {
    return EndpointType.FORECASTS;

  String getKey() {
    return HeadlessFragment.EXT_FORECAST;

Java Source Code List