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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:55:11+00:00 2026-05-27T13:55:11+00:00

I am unable to detect what is outgoing number, its always giving me null

  • 0

I am unable to detect what is outgoing number, its always giving me null pointer exception when i try to place outgoing call from device. I want to detect outgoing telephone number. Please advise, I tried searching solutions, but unable to make it work. Nullpointer exception is coming on this line -> Log.i("OutgoingCallReceiver",phonenumber);

12-07 16:10:50.576: ERROR/AndroidRuntime(3145): Caused by: java.lang.NullPointerException: println needs a message
12-07 16:10:50.576: ERROR/AndroidRuntime(3145):     at android.util.Log.println_native(Native Method)
12-07 16:10:50.576: ERROR/AndroidRuntime(3145):     at android.util.Log.i(Log.java:143)
12-07 16:10:50.576: ERROR/AndroidRuntime(3145):     at com.cwc.OutgoingCallReceiver.onReceive(OutgoingCallReceiver.java:27)
12-07 16:10:50.576: ERROR/AndroidRuntime(3145):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2810)
12-07 16:10:50.576: ERROR/AndroidRuntime(3145):     ... 10 more

Here is my class file

public class OutgoingCallReceiver extends BroadcastReceiver {


// private static final String INTENT_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER";

    @Override
    public void onReceive(Context context, Intent intent) {
            Bundle bundle = intent.getExtras();

            if(null == bundle)
                    return;


            String phonenumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);

            Log.i("OutgoingCallReceiver",phonenumber);
            Log.i("OutgoingCallReceiver",bundle.toString());

            String info = "Detect Calls sample application\nOutgoing number: " + phonenumber;

            Toast.makeText(context, info, Toast.LENGTH_LONG).show();
    }
}

I have following entry in manifest file

    <receiver android:name=".OutgoingCallReceiver">
        <intent-filter>
            <action android:name="android.intent.action.PHONE_STATE" />
        </intent-filter>
    </receiver>

</application>

<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
<uses-permission android:name="android.permission.READ_CONTACTS" />
  • 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-27T13:55:12+00:00Added an answer on May 27, 2026 at 1:55 pm

    Solved, I was missing “android.permission.PROCESS_OUTGOING_CALLS” user permission.
    It works now, here is my updated manifest file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unable to detect when input type=file changes its value after user selects
I am using zbar to scan barcodes from images. Zbar is unable to detect
Error: Unable to read data from the transport connection: A blocking operation was interrupted
I'm unable to execute the following prepared statement , PREPARE stmt FROM 'SELECT sb.id,sb.category,sb.make,sb.name,sb.pic,rs.slot
I'm getting an Unable to obtain public key for StrongNameKeyPair. exception using Newtonsoft's JsonConvert.SerializeObject
I am unable to detect the error in the following C++ program. The code
Is it possible to detect/reuse those settings ? How ? The exception i'm getting
I have a UIScrollView which contains any number of thumbnails that should detect the
I am using TextWatcher and I am unable to detect Backspace key in TextWatcher.afterTextChange
Currently with WMI's Win32_Process, I seem unable to detect if a batch file is

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.