Reputation: 550
I have used the calendar
class for a alarm app with the alarm manager
, but I have an error with the instance of the class calendar
.
I have investigated in other forums but I haven't find the proper solutions.
please I need your help.
Upvotes: 9
Views: 8299
Reputation: 1053
From Calendar pick date:
import java.util.Calendar
instead of this import android.icu.util.Calendar
And Then write those code code for Date Pick.
Calendar callForDate = Calendar.getInstance();
java.text.SimpleDateFormat currentDate = new java.text.SimpleDateFormat("dd-MMMM-yyyy");
final String saveCurrentDate = currentDate.format(callForDate.getTime());
Upvotes: 2
Reputation: 1
I had the same problem, changed the import from android.icu.util.Calendar to java.util.Calendar and it work! hope it helps you!
Upvotes: 0
Reputation: 387
As far as i can see, you could just use the normal Calendar instead of the in API 24 introduced ICU Calendar. Try to use this import java.util.Calendar
instead of this import android.icu.util.Calendar
.
Upvotes: 20