I am developing an android application in which i need to give some features of calendar like adding events and displaying events , There is no problem in insertion for that i am using the following code
Date date = new Date();
System.out.println("dateselected is " + dateselected);
try {
date = new SimpleDateFormat("yyyy-MM-dd").parse(dateselected);
} catch (java.text.ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
startTime = date.getTime();
System.out.println("startTime is " + startTime);
Calendar cal = Calendar.getInstance();
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra(" THE TESTING EVENT ");
intent.putExtra("beginTime", startTime);
intent.putExtra("endTime", startTime+60*60*1000);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
finish();
startActivityForResult(intent,0);
Displaying event in this way
intent.setData(Uri.parse("content://com.android.calendar/events/" +
String.valueOf(eventid[pos])));
System.out.println(" >8 ");
//Android 2.1 and below.
//intent.setData(Uri.parse("content://calendar/events/" + String.valueOf(calendarEventID)));
startActivity(intent);
but the problem is that no matter which date i selected and whatever the event id is it shows only one date and time ,
5:30 am , 1 January 1970
though the event title is correct
which i am testing on samsung galaxy pop android 2.2.1
What should i do to remove this error