Solved

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

Posted on 2014-11-03
4
308 Views
Last Modified: 2014-11-20
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
Comment
Question by:Rohit Bajaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 17

Expert Comment

by:Chris Harte
ID: 40419167
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 40420186
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
 

Author Comment

by:Rohit Bajaj
ID: 40420944
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
 
LVL 17

Accepted Solution

by:
Chris Harte earned 500 total points
ID: 40421577
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question