Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outgoing Call not Working.. #1

Open
GoogleCodeExporter opened this issue Jun 2, 2015 · 2 comments
Open

Outgoing Call not Working.. #1

GoogleCodeExporter opened this issue Jun 2, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link


Hi,
Incoming Call is working properly.
But when I tested Out Going call than It shows me Null Number in the Toast.

I tried to find out the solution but dont find any. Please suggest.


What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 May 2011 at 5:32

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author


package com.Service.child;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
import android.os.Bundle;
import android.os.Handler;
import android.telephony.TelephonyManager;
import android.telephony.gsm.SmsManager;
import android.util.Log;
import android.widget.Toast;

public class CallReceiveObserver extends BroadcastReceiver {
    String id;
    static long start_time,end_time,total_time;
    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub

        Bundle bundle = intent.getExtras();
        Log.i("hellooooooooooooooooooooo","hai");
        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;
        TelephonyManager telephonyManager=(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        id=telephonyManager.getDeviceId();
        start_time=System.currentTimeMillis();
        Toast.makeText(context, start_time+"", Toast.LENGTH_LONG).show();
        Toast.makeText(context, info, Toast.LENGTH_LONG).show();
        Toast.makeText(context, id, Toast.LENGTH_LONG).show();

        if( bundle.getString(TelephonyManager.EXTRA_STATE).equalsIgnoreCase(TelephonyManager.EXTRA_STATE_IDLE))
        {
            end_time=System.currentTimeMillis();
            total_time=end_time-start_time;

        }

    }
    }



Original comment by [email protected] on 24 May 2013 at 7:40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant