I solved my problem by adding some more screens to my app. So I have one for a New Task and one for Edit Task now and it works fine. I guess the auto increment Id wasn't the problem but the resetting of the field won't work and I think that messed it up.
But thanks for the reply.
Did I answer your question? Mark my post as a solution!