I have a dialog in my activity which is inside the onFinish method of a CountDownTimer.
So as soon as the timer finishes it callbacks the onFinish() method, which in turn displays the Dialog.
Now, my problem is, that when I click on the "Yes" button (positive button) of the Dialog, the Dialog shows again. When the "yes" button of this new Dialog is pressed then the function is completed.
But, why is the Dialog occuring again???
There is no problem in the reset1() method. I have checked it again and again.
I think you need to provide more info. The problem is likely because the timer gets started twice. This could happen depending on where your timer gets created and started. Remember you are not guaranteed to have just one instance of the activity running at a time. What I have seen - especially when the view is changed from portrait to landscape or back, that you can get different activities created for both cases. Or when the activity gets pushed to the background, then brought forward you may also get a new activity instance.
In these cases, the SavedState Bundle which usually gets passed to onCreate would be non-null. You should check that and determine what to do. You could, for example, override the onSaveState method (I think that's the name) to record when the time should complete into the SavedState bundle. Then kill the timer. Then in the onCreate method, check if the Bundle is null - if it is you know you need to start a new timer. If not, check for the time when the timer should complete, and if present, create a new timer counting down to that same time point. If the saved end-time is not in the bundle, decide something else to do that makes sense.
All that is conjecture, though. You would need to provide a small sample which shows the problem to get anything more than a guess.