package org.average.whereami;
import org.average.whereami.WhereAmIprefs;
+import org.average.whereami.APIBase;
import org.average.whereami.Oracle;
import org.average.whereami.PhoneLog;
import org.average.whereami.LastLocation;
for (int i = 0; i < ut.length; i++) {
ut[i].cancel();
}
+ runningtasks = 0;
Time tm = new Time();
tm.setToNow();
tvs.setText(R.string.failtry);
- tvs.append(tm.format(" %d/%m/%Y %H:%M:%S"));
+ tvs.append(tm.format(" %d/%m/%Y %H:%M"));
}
if (managewifi) {
boolean wifion = wifiman.setWifiEnabled(false);
tvt = (TextView)findViewById(R.id.time);
tvd = (TextView)findViewById(R.id.date);
tvs = (TextView)findViewById(R.id.timestamp);
+ APIBase base = new APIBase(res, store);
ut = new UpdateTarget[] {
new UpdateTarget((TextView)findViewById(R.id.phonecall),
- new PhoneLog(res, store)),
+ new PhoneLog(base)),
new UpdateTarget((TextView)findViewById(R.id.location),
- new LastLocation(res, store))
+ new LastLocation(base))
};
- Log.v(TAG, "created UI, about to start update task");
- mHandler.post(updateClock);
- mHandler.post(updateCal);
- mHandler.post(updateInfo);
- Log.v(TAG, "created UI, update task created");
}
/** Called when reactivated */
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
+ mHandler.post(updateClock);
+ mHandler.post(updateCal);
+ mHandler.post(updateInfo);
+ Log.v(TAG, "update tasks scheduled");
}
/** Called when put to background */
public void onPause() {
super.onPause();
Log.v(TAG, "going background");
+ resetInfo.run();
+ mHandler.removeCallbacks(updateClock);
+ mHandler.removeCallbacks(updateCal);
+ mHandler.removeCallbacks(updateInfo);
}
/** Called when the activity is destroyed. */
public void onDestroy() {
super.onDestroy();
Log.v(TAG, "going down");
- mHandler.removeCallbacks(updateClock);
- mHandler.removeCallbacks(updateCal);
- mHandler.removeCallbacks(updateInfo);
- if (connChangedRegistered) {
- unregisterReceiver(connChanged);
- connChangedRegistered = false;
- }
- if (managewifi) {
- boolean wifion = wifiman.setWifiEnabled(false);
- Log.v(TAG, "disabling wifi result " + wifion);
- }
}
/** Called when the menu is activated. */