Trying To Get Day_of_week From Calendar Causes Resource Not Found
I am trying to find the day of the week by: Calendar cd = Calendar.getInstance(); int dow = cd.get(Calendar.DAY_OF_WEEK); But whenever I load the program I get a Unable to Start A
Solution 1:
Try to delete the gen folder or clean the project using: Project-> Clean and try again.
Solution 2:
Does it have to be with calendar? There's other methods out there that doesn't involve the calendar to get the current day of the week..
edit:
<uses-permissionandroid:name="android.permission.READ_CALENDAR"></uses-permission><uses-permissionandroid:name="android.permission.WRITE_CALENDAR"></uses-permission>
Solution 3:
I think you are trying to update view with that int value which is not true (because setText method isn't overloaded for int type), you need to make array of strings like that
privatestaticfinalString[] WEEK = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
and use it
textView.setText(WEEK[cal.get(Calendar.DAY_OF_WEEK)]);
Post a Comment for "Trying To Get Day_of_week From Calendar Causes Resource Not Found"