简体   繁体   English

在Android中从自定义联系人列表应用程序拨打电话时显示姓名和号码

[英]Showing name along with number when making phone call from custom contact list app in android

I made a simple contact list app where user can save name and mobile number of person.User can also call the saved number by using this app.My problem is when making call number is shown,But name is not shown. 我做了一个简单的联系人列表应用程序,用户可以保存姓名和手机号码。用户也可以使用此应用程序调用保存的号码。我的问题是显示拨打电话号码,但名称不显示。 Can anyone know,How can I show the name along with the number when making call to someone from my custom contact list app??? 有谁知道,如何从我的自定义联系人列表应用程序拨打电话时显示姓名和号码?

here is my few part of my code 这是我的代码中的一小部分

c.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { 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);


        }
    });

Phone is not showing the name because that number doesn't exists in your contact list. 电话未显示名称,因为您的联系人列表中不存在该号码。 For showing the name instead of number while calling you need to store the number in contact using method shown in this post 要在呼叫时显示姓名而不是号码,您需要使用此帖子中显示的方法存储联系人号码

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

when contact is saved successfully whenever you call, it will show contact name. 当您在呼叫时成功保存联系人时,它将显示联系人姓名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Android的联系人列表访问电子邮件ID以及姓名和电话号码 - Access email-id along with name and phone number from contact list in Android Android:检查联系人列表中的电话号码? (电话号码从电话中检索) - Android : Check phone number present in Contact List ? (Phone number retrieve from phone call) Android从电话号码获取联系人姓名 - Android Get contact name from phone number Android:从电话号码中检索联系人姓名 - Android: Retrieve contact name from phone number Android从联系人列表中获取电话号码 - Android get phone number from contact list 用于在电话联系人中添加电子邮件 ID 以及姓名、电话号码的 Android 代码 - Android code to add email-id along with name,phone number in phone's contact 通过Android应用拨打电话 - Making Phone call from Android app Android - 无法从列表视图拨打不同的电话号码,但显示不同的电话号码 - Android - cannot call different phone number from list view but showing different phone number 在Android的列表视图中获取联系人姓名和电话号码的有效方法 - Efficient way of getting contact name and phone number in a List View in android 如何仅使用名称和电话号码在android中检索联系人列表 - how to retrieve the contact list in android with name and phone number only
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM