package com.example.martin.projetv5; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ListView; import java.util.ArrayList; /** * Created by martin on 18/02/2017. */ public class HistoriqueActivity extends AppCompatActivity implements EventAdapter.EventAdapterListener { ArrayList listEvents = new ArrayList<>(); EventAdapter adapter = null; ListView list = null; Event[] tabEvents = null; StringBDD eventBDD = null; void addEventList(Event ev, ArrayList listP){ listP.add(ev); adapter.notifyDataSetChanged(); } public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.historique_layout); adapter = new EventAdapter(this,listEvents); adapter.addListener(this); list = (ListView)findViewById(R.id.list2); list.setAdapter(adapter); eventBDD = new StringBDD(this); eventBDD.open(); int indMax = eventBDD.getIndiceMaxEvent(); tabEvents = new Event[indMax]; for(int j=0; j