How to catch touch event of an dialog when it is clicked outside
<p>Actually i have <code>Dialog</code> in my activity, what i want is suppose the dialog is open, then on Touch of outside dialog i want to dismiss the dialog and at the same time i want to call a function which do some update in my activity.</p>

<p>Initially i used <code>MyDialog.setCanceledOnTouchOutside(true);</code> But these will only dismiss and in my case, at the same time i want to call some functions whenever user click outside of dialog. So what should i do, I know that if i can extend the <code>Dialog</code> class and override its <code>onTouchEvent</code> method then it will be solved but in my case my class already extends Activity class and in java we can't extend more then one class..</p>

<p>So what will be the best solution for that. Please help me to solve this out</p>
