@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); view.mLatitude.addTextChangedListener(latLonTextWatcher); view.mLongitude.addTextChangedListener(latLonTextWatcher); mapController = view.mapView.getController(); view.mBtnPicture.setOnClickListener(this); view.mBtnAddCategory.setOnClickListener(this); view.mPickDate.setOnClickListener(this); view.mPickTime.setOnClickListener(this); mCalendar = Calendar.getInstance(); pendingPhoto = new UploadPhotoAdapter(this); view.gallery.setAdapter(pendingPhoto); view.gallery.setOnItemClickListener(this); view.mSwitcher.setFactory(this); if (getIntent().getExtras() != null) { this.id = getIntent().getExtras().getInt("id", 0); } mOgsDao = Database.mOpenGeoSmsDao; // edit existing report if (id > 0) { // make the delete button visible because we're editing view.mDeleteReport.setOnClickListener(this); view.mDeleteReport.setVisibility(View.VISIBLE); setSavedReport(id); } else { // add a new report updateDisplay(); pendingPhoto.refresh(); } registerForContextMenu(view.gallery); createSendMethodDialog(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.id = getIntent().getExtras().getInt("id", 0); mapController = view.mMapView.getController(); view.mPickPhoto.setOnClickListener(this); pendingPhoto = new UploadPhotoAdapter(this); view.gallery.setAdapter(pendingPhoto); view.gallery.setOnItemClickListener(this); view.mSwitcher.setFactory(this); // edit existing report if (id > 0) { // make the delete button visible because we're editing view.mDeleteCheckin.setOnClickListener(this); view.mDeleteCheckin.setVisibility(View.VISIBLE); setSavedCheckins(id); } else { // add a new report pendingPhoto.refresh(); } registerForContextMenu(view.gallery); hidePersonalInfo(); }