Android Open Source - cdb-android At Stop






From Project

Back to project page cdb-android.

License

The source code is released under:

GNU General Public License

If you think the Android project cdb-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ca.strangeware.cdb;
//from   w  w w  .  j  a  v a  2 s  .c o m
import android.content.Intent;
import android.database.Cursor;
import ca.strangeware.cdb.Schema.SchemaException;
import ca.strangeware.cdb.Schema.Stop;

public class AtStop extends TravelActivity {
  private Stop stop = null;
  
  @Override
  protected String[] columnNames() {
    return new String[] { "bus", "headsign" };
  }

  @Override
  protected Intent intent(long id) {
    Intent i = new Intent(this, OnBus.class);
    i.putExtra(ActivityIds.INTENT_KEY_PICKUP_ID, id);
    return i;
  }

  @Override
  protected Cursor query() throws SchemaException {
    return this.stop.upcoming_pickups();
  }

  @Override
  protected void updateObjects() {
    if ( null == this.stop ) {
      long id = getIntent().getLongExtra(ActivityIds.INTENT_KEY_STOP_ID, 0);
      try {
        this.stop = Schema.instance().lookupStop(id);
      } catch (SchemaException e) {
      } catch ( Exception e ) {
        e.printStackTrace();
      }
    }
  }

  @Override
  protected String title() {
    return this.stop.number + " " + this.stop.name;
  }

  @Override
  protected int arrivalIndex() {
    return 1;
  }
}




Java Source Code List

ca.strangeware.cdb.ActivityIds.java
ca.strangeware.cdb.AtStop.java
ca.strangeware.cdb.OnBus.java
ca.strangeware.cdb.Schema.java
ca.strangeware.cdb.Start.java
ca.strangeware.cdb.TravelActivity.java
ca.strangeware.cdb.TravelCursorAdapter.java