diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3bfffc7b3..ddd895514 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -31,11 +31,10 @@
-
-
+
+
-
@@ -55,7 +54,6 @@
-
diff --git a/app/src/main/java/com/android/calendar/AllInOneActivity.java b/app/src/main/java/com/android/calendar/AllInOneActivity.java
index 217ad589a..613ca113f 100644
--- a/app/src/main/java/com/android/calendar/AllInOneActivity.java
+++ b/app/src/main/java/com/android/calendar/AllInOneActivity.java
@@ -536,7 +536,7 @@ public void onClick(View v) {
}
});
}
-
+
private void hideActionBar() {
if (mActionBar == null) return;
mActionBar.hide();
@@ -986,10 +986,8 @@ public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth
} else if (itemId == R.id.action_view_agenda_tasks || itemId == R.id.action_view_agenda_events) {
FragmentManager manager = getFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
- AgendaFragment frag = (AgendaFragment) manager.findFragmentById(R.id.agenda_events_list);
- if (frag == null) {
- frag = new AgendaFragment(0L, false);
- }
+ long millis = Utils.timeFromIntentInMillis(getIntent());
+ AgendaFragment frag = new AgendaFragment(millis, false);
if (itemId == R.id.action_view_agenda_tasks) {
frag.isTask = true;
diff --git a/app/src/main/java/com/android/calendar/agenda/AgendaFragment.java b/app/src/main/java/com/android/calendar/agenda/AgendaFragment.java
index 37d0d7045..64d2bd53c 100644
--- a/app/src/main/java/com/android/calendar/agenda/AgendaFragment.java
+++ b/app/src/main/java/com/android/calendar/agenda/AgendaFragment.java
@@ -221,6 +221,14 @@ public void onResume() {
boolean hideDeclined = prefs.getBoolean(
GeneralPreferences.KEY_HIDE_DECLINED, false);
+ AgendaWindowAdapter.AgendaItem item = mAgendaListView.getFirstVisibleAgendaItem();
+ if (item!=null && item.isTask) {
+ Time t = new Time(mTimeZone);
+ t.set(item.end);
+ mController.setTime(item.end);
+ mTime.set(t.toMillis());
+ }
+
mAgendaListView.setHideDeclinedEvents(hideDeclined);
if (mLastHandledEventId != -1) {
mAgendaListView.goTo(mLastHandledEventTime, mLastHandledEventId, mQuery, true, false);
@@ -463,6 +471,7 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun
Time t = new Time(mTimeZone);
t.setJulianDay(mJulianDayOnTop);
mController.setTime(t.toMillis());
+ mTime.set(t.toMillis());
// Cannot sent a message that eventually may change the layout of the views
// so instead post a runnable that will run when the layout is done
if (!mIsTabletConfig) {
diff --git a/app/src/main/java/com/android/calendar/agenda/AgendaListView.java b/app/src/main/java/com/android/calendar/agenda/AgendaListView.java
index 37c5d6b71..f7ff5b8d9 100644
--- a/app/src/main/java/com/android/calendar/agenda/AgendaListView.java
+++ b/app/src/main/java/com/android/calendar/agenda/AgendaListView.java
@@ -39,6 +39,8 @@
import ws.xsoh.etar.R;
+import java.util.Calendar;
+
public class AgendaListView extends ListView implements OnItemClickListener {
private static final String TAG = "AgendaListView";
@@ -182,6 +184,12 @@ public void onItemClick(AdapterView> a, View v, int position, long id) {
!mShowEventDetailsWithAgenda)) {
long startTime = item.begin;
long endTime = item.end;
+ if (startTime==0) {
+ Calendar instance = Calendar.getInstance();
+ instance.setTimeInMillis(endTime);
+ instance.add(Calendar.MINUTE, -30);
+ startTime = instance.getTimeInMillis();
+ }
// Holder in view holds the start of the specific part of a multi-day event ,
// use it for the goto
long holderStartTime;