Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6726081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:53:04+00:00 2026-05-26T09:53:04+00:00

I am developing an app and have been able to start a phone call

  • 0

I am developing an app and have been able to start a phone call inside the app but when it end I want to resume the app with the information preserved and a pop up to come up.

I have been able to dial the call and get the pop up to come up in seperate instances but unable to put them together. This question has been answered in March of this year but I wanted to see if anyone else has come up with a better idea. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:53:04+00:00Added an answer on May 26, 2026 at 9:53 am

    Looking at the Activity Life cycle diagram, when a phone call is received application calls onPause() method. What I can think of is for you to do a saving of your data using SharedPreferences writing data from a thread which will run regardless if the application is not visible anymore to the user, either you do this in the call listener or in onPause() method. But more practical approach is to use onSaveInstanceState() method where you put all the relevant data which will be restored lately in onRestoreInstanceState() method.

    Another activity comes in front

    Read more here how they work:

    http://developer.android.com/reference/android/app/Activity.html#onRestoreInstanceState(android.os.Bundle)
    http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)
    http://developer.android.com/reference/android/telephony/PhoneStateListener.html

    In the PhoneStateListener class you can use some flags to mark if the call has taken place, when going to CALL_STATE_RINGING state, and then in the CALL_STATE_IDLE check whether call is made because IDLE state is occuring all the time when the phone is doing nothing, but when you have a flag you can check if(flag) do something and change the flag, so whenever the listener is again in CALL_STATE_IDLE your flag will be inverted so no actions again will be taken. Just an idea.

    Edit: Add the the PhoneStateListener class as inner class in your activity/service class and register phone state listener using TelephonyManager. I hope you’ll find your way

    public class MyClassActivity extends Activity
    {
        ....
        //set here your call listener here 
    
    }
    
    
    
    protected class PhoneState extends PhoneStateListener{
            private boolean mCall=false;
            @Override
            public void onCallStateChanged(int state, String incomingNumber) {
    
    
                 switch(state)
                 {
                 case TelephonyManager.CALL_STATE_RINGING:
                     mCall=true;  //fire the flag that there is call ongoing 
                     break;
                 case TelephonyManager.CALL_STATE_IDLE:
                    if(mCall)
                    {
                      mCall=false; //Reverting the flag, indicating you are aware that there was call
                      // Here do the rest of your operation you want
                    }
                     break;
    
                default:
                    }      
                super.onCallStateChanged(state, incomingNumber);
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the process of developing an Android app. I have been able to
I have been developing an app in VB.NET which requires a control object (for
I have been developing an app in FatFree framework and now I am trying
So I have been developing a small ASP.NET web app in C# for my
I have been putting off developing this part of my app for sometime purely
I have lately been developing a very simple app for iOS with PhoneGap. All
Trying to finish up an app I've been developing and have hit an odd
I have been developing an Android app and testing with a 1.5 AVD and
I have been developing an app using the very easy-to-pickup Flask system and I
I have been developing an app that supports streaming video and audio, among other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.