Android: Not able to add jobTitle field in Contacts using titanium

59 views Asked by At

I am not able to add JobTitle field in Android contacts.It working fine in IOS. Here is the testing code.

Ti.Contacts.createPerson({ 
firstName:'ABC', lastName:'DEF', organization :'Appcelerator', jobTitle : 'Developer', 
});
$.index.open();

Anyone knows, is there any other ways to add jobTitle field? or anything wrong in my above code.? Thanks in advance.

1

There are 1 answers

0
PRASHAANTH On

We can add contacts in android by intent, below code may help u

if (Titanium.Platform.name == 'android') 
        {
            var intent = Ti.Android.createIntent
            ({
                action: 'com.android.contacts.action.SHOW_OR_CREATE_CONTACT',
                data: 'mailto:'+firstName+' '+lastName
            });
                intent.putExtra('email', email);
                intent.putExtra('email_type', 'Work');
                intent.putExtra('phone', mobileno);
                intent.putExtra('phone_type', 'mobile');
                intent.putExtra('name', firstName+' '+lastName);

            Ti.Android.currentActivity.startActivity(intent);
        }

Following is the url for the intents

http://www.appcelerator.com/blog/2011/10/forging-titanium-episode-9-android-intent-cookbook/