• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • Last Modified:

How can the parent activity knows when the child activity has finished

Hi,
I am making a sample android app. In this when we click on call button the mobile dials a number.
here is the code :
Intent phoneIntent = new Intent(Intent.ACTION_CALL);
        phoneIntent.setData(Uri.parse("tel:" + Number));
         startActivity(phoneIntent);

This code starts a new activity which calls at the given Number. And the call finishes in about 30 seconds.
I want to execute a piece of code when the call gets finished

How can the parent activity know if the child activity (the calling one) has finished ?

Thanks
0
Rohit Bajaj
Asked:
Rohit Bajaj
  • 2
1 Solution
 
Chris HarteThaumaturgeCommented:
0
 
krakatoaCommented:
I don't know Android, but I would have thought that you'd need a reference held by the caller that it could use to determine when the child process had finished.
0
 
Rohit BajajAuthor Commented:
Hi MunterMan,
But i dont have access to onStop() method of the activity which i started. As this is the activity which will call a particular number from mobile
0
 
Chris HarteThaumaturgeCommented:
I think you are going to have to use the activity manager. This can test to see whether your activity is still running.

http://developer.android.com/reference/android/app/ActivityManager.html
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now