package com.example.scores.activities;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.widget.ListView;

import com.example.scores.R;
import com.example.scores.utilities.ScoreListAdapter;

public class DisplayScoresActivity extends Activity {
    private ScoreListAdapter adapter;
    private ArrayList<Parcelable> scores;
        
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.displayscores);

        // retrieve the data to load into the ListView from
        // the Intent as an extra
        Intent intent = getIntent();
        scores = intent.getParcelableArrayListExtra("Scores");

        adapter = new ScoreListAdapter(this, scores);
        ListView listView = (ListView) findViewById(R.id.list);
        listView.setAdapter(adapter);
    }
}
