You can write you own class which extends from TimerTask class and you can override run method.
class MyTimerTask extends TimerTask {
String param;
public MyTimerTask(String param) {
this.param = param;
}
@Override
public void run() {
// You can do anything you want with param
}
}