Open masterofn1 opened 7 years ago
Can you add steps to reproduce this? And preferably also some code
<com.alamkanak.weekview.WeekView android:id="@+id/weekView" android:layout_width="match_parent" android:layout_height="match_parent" ..........................................................
Then, I got these error
getting the same thing here unfortunately
Also getting the same error here
Same issue. Pls give solutions soon
Is the problem related to WeekView.java line 969 -> throw new IllegalStateException("You must provide a MonthChangeListener")?
I was able to solved this:
You must provide a MonthChangeListener in which you should return at least an empty List of WeekViewEvent Class:
@Pralo Yes you're right. In the example app, the BaseActivity
class is meant to implement the MonthChangeListener method but never does (you can see that the method is actually implemented in the BasicActivity
class.) Having the MonthChangeListener in the right class fixes the issue.
NOTE: You do get a Null Pointer Exception when looking at the XML in the editor, but it fixes it's self when you run on an emulator or a real device.
Hello, can you specify the solution in some more detail, as I am having this issue still.
In the sample app change BasicActivity. java file content to the below content
import com.alamkanak.weekview.WeekViewEvent;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import com.alamkanak.weekview.MonthLoader;
public class BasicActivity extends BaseActivity implements MonthLoader.MonthChangeListener {
@Override
public List<? extends WeekViewEvent> onMonthChange(int newYear, int newMonth) {
List<WeekViewEvent> events = new ArrayList<WeekViewEvent>();
return events;
}
}
Hope this Help!
Upon carefully following the given instructions, I added the gradle dependency. On the moment I am calling the view component on a layout file, I got a null pointer exception.