1

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) {

            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);


        }
    });
Tausif
  • 778
  • 1
  • 5
  • 14

1 Answers1

0

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

when contact is saved successfully whenever you call, it will show contact name.

Community
  • 1
  • 1
Nitesh Verma
  • 2,460
  • 4
  • 20
  • 36