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
How i delete selected person to ContactList in application (Titanium- Android)?
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:
- The Appcelerator's intent CookBook information.
- This source used in the presentation above.
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;
})()
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.