【问题标题】:Showing name along with number when making phone call from custom contact list app in android从android中的自定义联系人列表应用程序拨打电话时显示姓名和号码
【发布时间】:2017-02-25 07:07:30
【问题描述】:

我做了一个简单的联系人列表应用程序,用户可以保存姓名和手机号码。用户也可以使用此应用程序拨打保存的号码。我的问题是拨打电话号码时显示,但姓名不显示。 谁能知道,我如何在通过我的自定义联系人列表应用程序向某人拨打电话时显示姓名和号码???

这是我的代码的一小部分

c.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {

            Toast.makeText(Showdetail1.this, "call button clicked :"+contact.get_mobile(),
                    Toast.LENGTH_LONG).show();

            Intent callIntent = new Intent(Intent.ACTION_CALL);
            callIntent.setData(Uri.parse("tel:"+contact.get_mobile()));

            //change the number
            //callIntent.putExtra("com.android.phone.extra.slot", 0); //For sim 1
            startActivity(callIntent);


        }
    });

【问题讨论】:

    标签: android


    【解决方案1】:

    电话未显示姓名,因为您的联系人列表中不存在该号码。为了在呼叫时显示姓名而不是号码,您需要使用本文中显示的方法将号码存储在联系人中

    https://stackoverflow.com/a/4744514/3758972

    当您拨打电话成功保存联系人时,它会显示联系人姓名。

    【讨论】:

    • 明白了!我会试试你提供的链接。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-11
    相关资源
    最近更新 更多