En el siguiente código
t.schedule (timertask, d.getDate(), 1000); es tirar excepción NullPointer me ayudeLanzamiento de pointerException en Timer.Schedule();
Objetivo:
Mi objetivo básico es Run un método (cada vez después de un intervalo fijo) que enviar algunos datos para webservice desde mi dispositivo Android
Date d = new Date();
d.getDate();
timertask = new TimerTask() {
@Override
public void run() {
new Thread() {
public void run() {
try {
ProDialog = ProgressDialog.show(Home.this,
"Sending Data",
"Please wait while sending data...");
Looper.prepare();
sendLocation();
handler.sendEmptyMessage(0);
quit();
Looper.loop();
} catch (Exception e) {
ProDialog.dismiss();
}
}
public void quit() {
ProDialog.dismiss();
Looper.myLooper().quit();
}
}.start();
}
};
try {
t.schedule(timertask, d.getDate(), 1000);
} catch (Exception e) {
e.printStackTrace();
}
lo es t por favor? – Sajmon
Agregue stacktrace – SJuan76
Es posible que no haya inicializado todas sus variables. – TRonZ