I am currently performing a network check (wifi or data service) on an asyntask and it works fine but when ever the task is executed more than ones my application crashes and generates this exception
java.lang.IllegalStateException: Cannot execute task: the task has already been executed (a task can be executed only once)
Same goes for my volley request....when ever a request is unsuccessful and i retry it by clicking a button my application crashes and throws an exception stating request has already been executed
.
Please guys how do i re-initialize or remove a request/task to prevent such errors.
Alternatively can anyone suggest how i can solve this problem.
This question doesn't contain any code because my AsynTask and volley request are work except the exception generated when i retry a task or request.
Thanks in advance.