I have a application Myapp from with I call the phone system and then call dialnumber function ( which is similar that the dialer in the sdk)

How to gain focus in myapplication, once the call is ended or cancelled,

any help.....