Solved

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

Posted on 2014-11-03
4
246 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
  • 2
4 Comments
 
LVL 16

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 16

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is a continuation of Part-1 as evident from the title. Please visit this page (http://www.experts-exchange.com/articles/18706/Backing-up-personal-data-on-your-Android-device-Part-1.html) to read the earlier Part -1. If y…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now