Monday, July 11, 2016

[Android][Resolved] Cannot resolve constructor 'Date()'


Error:(46, 96) error: no suitable constructor found for Date(no arguments)
constructor Date.Date(int,int,int) is not applicable
(actual and formal argument lists differ in length)
constructor Date.Date(long) is not applicable
(actual and formal argument lists differ in length)
Make sure you have imported java.util.Date in your java file:
import java.util.Date;
If you import use auto import the necessary classes feature in Android Studio, sometimes it would suggest import java.sql.Date; make sure that's import java.util.Date.
import java.io.File;
import java.io.IOException;
import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.Date;

Reference:
http://stackoverflow.com/questions/29884388/android-cannot-resolve-constructor-date/29886021

No comments :

Post a Comment