1

I am currently working on MessageActivity, here I am displaying :

  1. Contact Name
  2. Contact Number

In Menu Item I am displaying two Menu items in same screen on top:

  1. AddContact
  2. View Details

I have a problem with displaying, If ContactName is added in phone then it will disply only ViewDeitals in menu, and If contact is not addded then it will show AddContact in Menu items.

If contact number is there then how to add that phone number into contact details in phone

BSK
  • 65
  • 1
  • 1
  • 10
  • "And How to add contact that number,suggest me code" is unclear. "Suggest me code" this is not how this website works... https://stackoverflow.com/help – shkschneider May 07 '15 at 08:55

1 Answers1

0

Check if contact number is present in your contact list using following link: contact exists in contacts

Then depending upon the result change menus by calling in invalidateOptionsMenu() which will call onPrepareActionMode(). In this fuction hide/show menu items.

Community
  • 1
  • 1