Commit | Line | Data |
---|---|---|
0b5b93a4 PT |
1 | package ro.ieval.unical; |
2 | ||
3 | import java.util.Arrays; | |
4 | import java.util.GregorianCalendar; | |
5 | import java.text.DateFormat; | |
6 | import java.util.Date; | |
7 | ||
8 | import ro.ieval.unical.R; | |
9 | import android.app.Activity; | |
10 | import android.os.Bundle; | |
11 | import android.text.format.DateUtils; | |
12 | import android.widget.Button; | |
13 | import android.widget.LinearLayout; | |
14 | ||
15 | ||
16 | public class EventListActivity extends Activity { | |
17 | GregorianCalendar gc; | |
18 | ||
19 | @Override | |
20 | protected void onCreate(Bundle savedInstanceState) { | |
21 | // TODO Auto-generated method stub | |
22 | super.onCreate(savedInstanceState); | |
23 | setContentView(R.layout.event_list); | |
24 | ||
25 | Date d=new Date(); | |
26 | d.getTime(); | |
27 | gc=new GregorianCalendar(); | |
28 | gc.setTime(d); | |
29 | ||
30 | Event r[]=Event.getAllEvents(getBaseContext()); | |
31 | LinearLayout ll = (LinearLayout)findViewById(R.id.eventslayout); | |
32 | Button[] b=new Button[10]; | |
33 | Arrays.sort(r,new EventComparator()); | |
34 | for(int i=0; i<r.length; ++i) if(r[i].dtstart<=gc.getTimeInMillis()){ | |
35 | Button EventButton=new Button(getBaseContext()); | |
36 | EventButton.setText(r[i].title); | |
37 | ll.addView(EventButton); | |
38 | } | |
39 | } | |
40 | } |