/** * Called when Activity is first created. Initialises all appropriate fields and Constructs the * Views for display. (non-Javadoc) * * @see android.app.Activity#onCreate(android.os.Bundle) */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.todo_list_view); Bundle b = this.getIntent().getExtras(); if (b != null && b.containsKey("InvokedFromView")) invokedFromView = true; // make sure aCalService is running this.startService(new Intent(this, aCalService.class)); // Set up buttons this.setupButton(R.id.todo_add_button, ADD, "+"); this.setSelections(); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); gestureDetector = new GestureDetector(this); Intent ourIntent = this.getIntent(); int year = ourIntent.getIntExtra(KEY_START_YEAR, -1); if (year == -1) { long selectedMillis = ourIntent.getLongExtra(KEY_SELECTED_MILLIS, -1L); if (selectedMillis == -1L) selectedDate = AcalDateTime.getInstance(); else selectedDate = AcalDateTime.getInstance().setMillis(selectedMillis); } else { this.selectedDate = new AcalDateTime(year, 1, 1, 0, 0, 0, null); } this.setContentView(R.layout.year_view); view = (CustomYearDrawable) this.findViewById(R.id.year_view_custom); // Set up buttons this.setupButton(R.id.year_today_button, TODAY); this.setupButton(R.id.year_month_button, MONTH); this.setupButton(R.id.year_add_button, ADD); }