I came into this whilst spending my night programming.
//Reader class isn't java.io but it's from third party library
public class ACR122U extends Reader {
// This method is called from outside
// This method overrides method of the Reader class
@Override
public void open(UsbDevice device) {
new OpenTask().execute(device);
}
private class OpenTask extends AsyncTask<UsbDevice, Void, Exception> {
@Override
protected Exception doInBackground(UsbDevice... params) {
Exception result = null;
try {
// There the problem (recursion) happens
// I don't want to call ACR122U.open() but Reader.open()
// I cannot call super.open() /super of OpenTask class is AsyncTask/
open(params[0]);
} catch (Exception e) {
result = e;
}
return result;
}
}
}
and I'm wondering if it's possible to solve the problem without changing name of open() method. Any idea?
PS: Newbie here.