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 7588391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:54:32+00:00 2026-05-30T19:54:32+00:00

I am trying to identify and transfer to an activity after an outgoing call

  • 0

I am trying to identify and transfer to an activity after an outgoing call is initiated. I used ACTION_NEW_OUTGOING_CALL in the Intent filter. However how csn I identify that the call is outgoing. I did this for an incoming call (as seen below) but what can I use instead of EXTRA_STATE_RINGING.

public class OutgoingBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
        if (state.equals(TelephonyManager.EXTRA_STATE_RINGING))
        {
            Intent i = new Intent(context, OutgoingCallScreenDisplay.class);
            i.putExtras(intent);
            i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(i);
        }
    }
}

enter image description here

  • 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-30T19:54:34+00:00Added an answer on May 30, 2026 at 7:54 pm
    public class OutgoingBroadcastReceiver extends BroadcastReceiver {
    
        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
               // If it is to call (outgoing)
               Intent i = new Intent(context, OutgoingCallScreenDisplay.class);
               i.putExtras(intent);
               i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
               context.startActivity(i);
            }
        }
    }
    

    ACTION_NEW_OUTGOING_CALL is a constant declare in the Intent class, not in TelephonyManager. When an outgoing call appears, then the system broadcasts an intent with this constant. If you really want to catch an outgoing call by using TelephonyManager then do this:

    TelephonyManager tm = (TelephonyManager)context.getSystemService(Service.TELEPHONY_SERVICE);   
    tm.listen(listener, PhoneStateListener.LISTEN_CALL_STATE);
    PhoneStateListener listener = new PhoneStateListener() {
        @Override
        public void onCallStateChanged(int state, String incomingNumber) {
            // TODO Auto-generated method stub
    
            super.onCallStateChanged(state, incomingNumber);
            switch(state) {
                case TelephonyManager.CALL_STATE_IDLE:
                    break;
                case TelephonyManager.CALL_STATE_OFFHOOK:
                    if(incomingNumber==null) {
                        //outgoing call
                    } else {
                        //incoming call
                    }
                    break;
                case TelephonyManager.CALL_STATE_RINGING:
                    if(incomingNumber==null) {
                        //outgoing call
                    } else {
                        //incoming call
                    }
                    break;
            }
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to identify all the nodes in a tree that lead to
I am trying to identify SQL INSERTS that occur when a record is viewed
I'm trying to identify a view that has been clicked in an expandableListView. When
I'm trying to identify an empty element that might or might not contain a
I am trying to identify the consecutive three-column groups that have >2 instances of
I'm trying to identify the Navigation Bar in the current view so that I
I am trying to write a script that will let me identify bots that
I am trying to make an Android app that could identify if an app
I am trying to identify all the <UL> that contain a menu list by
I'm trying to identify which OSX application is currently active. I understand that in

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.