I am having string date = "2014-09-11"
.
i want to set this string to calendar object.
The string value is already having "-" in it. So how to use date formatting?
You should use a date format to parse your string
String dateStr = "2014-09-11";
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
DateTime date = format.parse(dateStr);
Calendar cal = Calendar.getInstance();
cal.setTime(date);