[英]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.