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
Solved

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

Posted on 2014-11-03
4
288 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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java exception bubble up 2 21
Android development question 2 52
Problem to Alipay 10 42
Java syntax, or is it Selenium 6 30
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

809 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