如何让拨打的手机号码,在我的应用程序? [英] how to get dialed mobile number in my application?

查看:68
本文介绍了如何让拨打的手机号码,在我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  拨打号码

我想从拨号器这在我的Andr​​oid application.I拨打了用户已经实现的应用程序获取手机号码如下:

I would like to get the mobile number from dialer which has dialed by user in my android application.I have implemented an application as follows:

 ((Button)findViewById(R.id.button1)).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
             startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:")));

        }
    });

从上面的codeI可以打开拨号程序app.If用户输入手机号码,然后点击呼叫,然后我想获得该号码他已经打出来。 请任何机构的帮助就可以了...

from the above code i can open dialer app.If user enter a mobile number and click for call then i would like to get which number he has typed. please any body help on it...

推荐答案

我得到了我的解决方案如下code

I got my solution as following code

public class OutGoingCall extends BroadcastReceiver {

   @Override
   public void onReceive(final Context context, final Intent intent) 
   {
         // get phone number from bundle
         String phoneNumber = intent.getExtras().getString(OutGoingCall.INTENT_PHONE_NUMBER);

   }
}

这篇关于如何让拨打的手机号码,在我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆