@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
-
+
// Eliminate extra GCs during startup by setting the initial heap size to 4MB.
// TODO: We should restore the old heap size once the activity reaches the idle state
VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
if (DEBUGLOG) {
Log.e(TAG, "refresh " + goToTime.toString() + (forced ? " forced" : " not forced"));
}
-
+
int startDay = Time.getJulianDay(goToTime.toMillis(false), goToTime.gmtoff);
if (!forced && isInRange(startDay, startDay)) {
// Notify Listview of changes and update position
int cursorSize = cursor.getCount();
- if (cursorSize > 0 || mAdapterInfos.isEmpty()) {
+ if (cursorSize > 0 || mAdapterInfos.isEmpty() || data.queryType == QUERY_TYPE_CLEAN) {
final int listPositionOffset = processNewCursor(data, cursor);
if (data.goToTime == null) { // Typical Scrolling type query
notifyDataSetChanged();
if (newPosition >= 0) {
mAgendaListView.setSelection(newPosition + OFF_BY_ONE_BUG);
}
- if (DEBUGLOG)
+ if (DEBUGLOG) {
Log.e(TAG, "Setting listview to " +
- "findDayPositionNearestTime: " + (newPosition + OFF_BY_ONE_BUG));
+ "findDayPositionNearestTime: " + (newPosition + OFF_BY_ONE_BUG));
+ }
}
} else {
cursor.close();