我想在 2 中显示入住和退房的第一个和最后一个日期textviews
我正在使用 timesquare Android studio 和 SelectionMode = RANGE 这是我的代码:
public class SelectDates extends AppCompatActivity {
TextView checkin, checkout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_dates);
Date today = new Date();
Calendar nextYear = Calendar.getInstance();
nextYear.add(Calendar.YEAR, 1);
checkin = (TextView)findViewById(R.id.checkin);
checkout = (TextView)findViewById(R.id.checkout);
final Button btnshowdates = (Button) findViewById(R.id.btnshowdates);
final CalendarPickerView datePicker = findViewById(R.id.calendar);
datePicker.init(today, nextYear.getTime())
.inMode(CalendarPickerView.SelectionMode.RANGE)
.withSelectedDate(today);