public UpdateTarget(TextView tv, Integer updater) {
this.tv = tv;
this.updater = updater;
- this.task = new BgUpdate();
}
public void launch() {
tv.setText(R.string.updating);
+ task = new BgUpdate();
task.execute();
}
+
+ public void cancel() {
+ task.cancel(true);
+ }
}
private UpdateTarget[] ut;
boolean wifion = wifiman.setWifiEnabled(true);
Log.w("WhereAmI", "enabling wifi result " + wifion);
mHandler.postDelayed(resetInfo, 30000);
- mHandler.postDelayed(this, 1200000);
+ mHandler.postDelayed(this, 60000);
}
};
public void run() {
Log.w("WhereAmI", "resetInfo starting");
unregisterReceiver(connChanged);
- boolean wifion = wifiman.setWifiEnabled(false);
- Log.w("WhereAmI", "disabling wifi result " + wifion);
if (runningtasks > 0) {
+ for (int i = 0; i < ut.length; i++) {
+ ut[i].cancel();
+ }
Time tm = new Time();
tm.setToNow();
tvs.setText(R.string.failtry);
tvs.append(tm.format(" %d/%m/%Y %H:%M:%S"));
}
+ boolean wifion = wifiman.setWifiEnabled(false);
+ Log.w("WhereAmI", "disabling wifi result " + wifion);
}
};