How i delete selected person to ContactList in application (Titanium- Android)?
Asked Answered
B

1

10

I use getAllPerson() function and show all people in TableView i want to do delete selected person. but removePerson() only supported for iphone, how i delete with Android. any suggestion appreciated

Bailey answered 28/5, 2012 at 10:58 Comment(0)
B
1

I don't know how you implemented the edit action that should remove the selected person, but, I think that, as the removePerson is not yet implemented (may be never) for Android, you have to use intents.

For this, here are two sources where you can find all the information you have to know:

On by clicking on the person you want to delete, you have to get his contact ID.

Then, here is where I'm not sure at all :

intent: (function() {
    var contactId = '1'; // Your contact ID !!!
    if (contacts[0]) {
        contactId = parseInt(contacts[0].id) + '';
    }
    var contactUrl = 'content://com.android.contacts/raw_contacts/' + contactId;
    var intent = Ti.Android.createIntent({
        action: Ti.Android.ACTION_DELETE,
        data: contactUrl
    });
    return intent;
})()
Breechblock answered 31/5, 2012 at 11:11 Comment(1)
I never said that this code snippet will work (this is why I mentioned : "I'm not sure at all"). But, this is the way it should work : intents. Please, check out the links above.Breechblock

© 2022 - 2024 — McMap. All rights reserved.