Android Open Source - android-facade-example Station Data List Fragment

From Project

Back to project page android-facade-example.


The source code is released under:

MIT License

If you think the Android project android-facade-example 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.ruenzuo.weatherapp.fragments;
//w  w w. ja v  m
import android.os.Bundle;

import com.ruenzuo.weatherapp.R;
import com.ruenzuo.weatherapp.adapters.StationDataAdapter;
import com.ruenzuo.weatherapp.models.StationData;

import java.util.ArrayList;

 * Created by ruenzuo on 10/05/14.
public class StationDataListFragment extends ListFragment {

    private StationData stationData;
    private static final String DEGREE  = "\u00b0";

    public StationData getStationData() {
        return stationData;

    public void setStationData(StationData stationData) {
        this.stationData = stationData;

    public void onActivityCreated(Bundle savedInstanceState) {
        ArrayList<String> values = new ArrayList<String>();
        values.add(String.format("%.2f ", stationData.getTemperature()) + DEGREE + "K");
        values.add(String.format("%.2f hpa", stationData.getPressure()));
        values.add(String.format("%.2f %%", stationData.getHumidity()));
        StationDataAdapter adapter = new StationDataAdapter(getActivity(), R.layout.row_station_data);


Java Source Code List