I have the following implementation of AsyncTask
, allowing multiple AsyncTask
s to run concurrently:
public abstract class MyAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {
public AsyncTask<Params, Progress, Result> executeCompat(Params... params) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return executeOnExecutor(THREAD_POOL_EXECUTOR, params);
} else {
return execute(params);
}
}
}
Now to avoid confusion and accidental use of the normal AsyncTask
, I would like to block access from my code to:
- The
AsyncTask
class, onlyMyAsyncTask
should be used. - The
execute()
function inMyAsyncTask
.
Is it possible to do this?