This ImageUpload function works, but it keep on adding on in copies each time I upload a new photo. That i not what I want. When I upload the first image, it work as it should. One image is uploaded to my server. But when I continue by choosing or taking a new photo, it uploads two copies of the same photo. The third image I upload becomes uploaded tree times, the next four times and so it grows in copies uploaded each time. Only if I restart the app, it starts from one copy upload again. I hope someone can see whats wrong or how I can reset the "selectedImage" after a upload process.

1 Answer
1

You are adding a click listener in some click event. Therefore, every time the first click event is executed, another click event will be added to buttonUpload and executed as many times as the first click event is called.

Thank you so very much. I deleted one of the buttonUpload eventListeners and moved the other outside of the dialogEventListener and now the function works as I wanted it to. Thank you again.
–
user1440794Aug 13 '12 at 11:38