/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/TimetableList.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/TimetableList.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 839 by torben, Fri Jun 11 17:39:11 2010 UTC revision 906 by torben, Fri Jun 25 23:59:58 2010 UTC
# Line 19  import android.content.Intent; Line 19  import android.content.Intent;
19  import android.os.AsyncTask;  import android.os.AsyncTask;
20  import android.os.Bundle;  import android.os.Bundle;
21  import android.util.Log;  import android.util.Log;
22    import android.view.View;
23    import android.widget.ListView;
24  import android.widget.TextView;  import android.widget.TextView;
25    import android.widget.Toast;
26  import dk.thoerup.traininfo.provider.ProviderFactory;  import dk.thoerup.traininfo.provider.ProviderFactory;
27  import dk.thoerup.traininfo.provider.TimetableProvider;  import dk.thoerup.traininfo.provider.TimetableProvider;
28  import dk.thoerup.traininfo.util.MessageBox;  import dk.thoerup.traininfo.util.MessageBox;
# Line 66  public class TimetableList extends ListA Line 69  public class TimetableList extends ListA
69          }          }
70                    
71                    
72      @Override      @Override
73            protected void onListItemClick(ListView l, View v, int position, long id) {
74                    super.onListItemClick(l, v, position, id);
75    
76                    TimetableBean tt = timetables.get(position);
77                    
78                    StationBean station = new StationBean();
79                    station.setName( tt.getStation() );
80                    station.setId( tt.getStationId() );
81                    station.setRegional(true);
82                    
83                    Intent intent = new Intent(this, DepartureList.class);
84                    intent.putExtra("stationbean", station);
85                    startActivity(intent);
86                    
87            }
88        
89    
90    
91            @Override
92      public void onSaveInstanceState(Bundle outState)      public void onSaveInstanceState(Bundle outState)
93      {                {          
94          dismissDialog(DLG_PROGRESS);          dismissDialog(DLG_PROGRESS);
# Line 117  public class TimetableList extends ListA Line 139  public class TimetableList extends ListA
139                          if (success) {                          if (success) {
140                                  adapter.setTimetable(timetables);                                  adapter.setTimetable(timetables);
141                                  if (timetables.size() == 0) {                                  if (timetables.size() == 0) {
142                                          MessageBox.showMessage(TimetableList.this, getString(timetablelist_nodata));                                          MessageBox.showMessage(TimetableList.this, getString(timetablelist_nodata), true);
143                                  }                                  }
144                          } else { // communication or parse error                          } else { // communication or parse error
145                                  AlertDialog.Builder builder = new AlertDialog.Builder(TimetableList.this);                                                                                AlertDialog.Builder builder = new AlertDialog.Builder(TimetableList.this);                                              
# Line 133  public class TimetableList extends ListA Line 155  public class TimetableList extends ListA
155                                  builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {                                  builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() {
156                                          public void onClick(DialogInterface dialog, int id) {                                          public void onClick(DialogInterface dialog, int id) {
157                                                  dialog.dismiss();                                                  dialog.dismiss();
158                                                    TimetableList.this.finish();
159                                          }                                                                                                }                                                      
160                                  });                                  });
161                                                                    

Legend:
Removed from v.839  
changed lines
  Added in v.906

  ViewVC Help
Powered by ViewVC 1.1.20