|
| 1 | +/* |
| 2 | + * Copyright (C) 2014 The Android Open Source Project |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
1 | 16 | package com.example.android.sunshine.app; |
2 | 17 |
|
3 | | -import android.support.v7.app.ActionBarActivity; |
4 | | -import android.support.v4.app.Fragment; |
5 | 18 | import android.os.Bundle; |
| 19 | +import android.support.v4.app.Fragment; |
| 20 | +import android.support.v7.app.ActionBarActivity; |
6 | 21 | import android.view.LayoutInflater; |
7 | 22 | import android.view.Menu; |
8 | 23 | import android.view.MenuItem; |
9 | 24 | import android.view.View; |
10 | 25 | import android.view.ViewGroup; |
11 | 26 |
|
| 27 | +import java.util.ArrayList; |
| 28 | +import java.util.Arrays; |
| 29 | +import java.util.List; |
| 30 | + |
| 31 | + |
12 | 32 |
|
13 | 33 | public class MainActivity extends ActionBarActivity { |
14 | 34 |
|
@@ -55,7 +75,19 @@ public PlaceholderFragment() { |
55 | 75 |
|
56 | 76 | @Override |
57 | 77 | public View onCreateView(LayoutInflater inflater, ViewGroup container, |
58 | | - Bundle savedInstanceState) { |
| 78 | + Bundle savedInstanceState) { |
| 79 | + |
| 80 | + // Create some dummy data for the ListView. Here's a sample weekly forecast |
| 81 | + String[] data = { |
| 82 | + "Mon 6/23 - Sunny - 31/17", |
| 83 | + "Tue 6/24 - Foggy - 21/8", |
| 84 | + "Wed 6/25 - Cloudy - 22/17", |
| 85 | + "Thurs 6/26 - Rainy - 18/11", |
| 86 | + "Fri 6/27 - Foggy - 21/10", |
| 87 | + "Sat 6/28 - TRAPPED IN WEATHERSTATION - 23/18", |
| 88 | + "Sun 6/29 - Sunny - 20/7" |
| 89 | + }; |
| 90 | + List<String> weekForecast = new ArrayList<String>(Arrays.asList(data)); |
59 | 91 | View rootView = inflater.inflate(R.layout.fragment_main, container, false); |
60 | 92 | return rootView; |
61 | 93 | } |
|
0 commit comments