final ActionBar actionBar = getActionBar();
setContentView(R.layout.add_event);
- if(getIntent().hasExtra(EXTRA_EVENT)) {
- final LinearLayout layout = (LinearLayout) findViewById(R.id.repeat_layout);
- final Switch repeatSwitch = (Switch) findViewById(R.id.repeat_switch);
- Utils.setEnabledRecursively(layout, false);
-
- repeatSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener(layout));
-
- EditText title = (EditText) findViewById(R.id.eventtitle);
- title.setText(event.title);
-
- TextView tstart = (TextView) findViewById(R.id.time_start);
- TextView tend = (TextView) findViewById(R.id.time_end);
- SimpleDateFormat sf=new SimpleDateFormat("HH:mm");
- Date d=new Date(event.dtstart);
- tstart.setText(sf.format(d).toString());
- d.setTime(event.dtend);
- tend.setText(sf.format(d).toString());
-
- SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
- TextView dstart = (TextView)findViewById(R.id.date_start);
- TextView dend = (TextView)findViewById(R.id.date_end);
- d.setTime(event.dtstart);
- dstart.setText(sd.format(d).toString());
- d.setTime(event.dtend);
- dend.setText(sd.format(d).toString());
- EditText description = (EditText) findViewById(R.id.description);
- description.setText(event.description);
- }
+ final LinearLayout layout = (LinearLayout) findViewById(R.id.repeat_layout);
+ final Switch repeatSwitch = (Switch) findViewById(R.id.repeat_switch);
+ Utils.setEnabledRecursively(layout, false);
+
+ repeatSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener(layout));
+
+ final EditText title = (EditText) findViewById(R.id.eventtitle);
+ title.setText(event.title);
+
+ final TextView tstart = (TextView) findViewById(R.id.time_start);
+ final TextView tend = (TextView) findViewById(R.id.time_end);
+ final SimpleDateFormat sf=new SimpleDateFormat("HH:mm");
+ final Date d=new Date(event.dtstart);
+ tstart.setText(sf.format(d).toString());
+ d.setTime(event.dtend);
+ tend.setText(sf.format(d).toString());
+
+ final SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
+ final TextView dstart = (TextView)findViewById(R.id.date_start);
+ final TextView dend = (TextView)findViewById(R.id.date_end);
+ d.setTime(event.dtstart);
+ dstart.setText(sd.format(d).toString());
+ d.setTime(event.dtend);
+ dend.setText(sd.format(d).toString());
+ final EditText description = (EditText) findViewById(R.id.description);
+ description.setText(event.description);
}
@Override