Calendar not show. What i am doing wrong?
/Layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:calendar="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/login_background" tools:context="com.example.enny.agendando.ui.activities.SelectDateActivity">
<com.andexert.calendarlistview.library.DayPickerView
android:id="@+id/pickerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
calendar:drawRoundRect="true" />
Activity Class:
package com.example.enny.agendando.ui.activities;
import android.app.Activity; import android.os.Bundle; import android.util.Log;
import com.andexert.calendarlistview.library.DayPickerView; import com.andexert.calendarlistview.library.SimpleMonthAdapter; import com.example.enny.agendando.R;
public class SelectDateActivity extends Activity implements com.andexert.calendarlistview.library.DatePickerController {
private DayPickerView dayPickerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_date);
dayPickerView = (DayPickerView) findViewById(R.id.pickerView);
dayPickerView.setController(this);
}
@Override
public int getMaxYear() {
return 2015;
}
@Override
public void onDayOfMonthSelected(int year, int month, int day) {
Log.e("Day Selected", day + " / " + month + " / " + year);
}
@Override
public void onDateRangeSelected(SimpleMonthAdapter.SelectedDays<SimpleMonthAdapter.CalendarDay> selectedDays) {
Log.e("Date range selected", selectedDays.getFirst().toString() + " --> " + selectedDays.getLast().toString());
}
}
Try setting 2016 in getMaxYear() method. It should work
RiccardoFabozzi 's method are correctly
Modify the following location code:SimpleMonthAdapter > getItemCount > return Math.abs(itemCount);