I think a found a simpler approach:
public interface MyRunnable extends Runnable {
public void run(int data);
}
public void someMethod(int n, String s, MyRunnable r) {
...
r.run(n);
...
}
the call:
someMethod(5, "Hello", new MyRunnable() {
@Override
public void run(int data) {
// TODO Auto-generated method stub
}
@Override
public void run() {
// TODO Auto-generated method stub
}
});