0

I've created a custom contacts sync adapter, and an app to to edit the contact data for the custom contacts. The stock app can't edit them anyway -- it would only allow editing of the name. I've also set up my editor app to have the EDIT inten, so that when a user tries to edit a contact, they will be given a choice of which app to use (currently either the stock contacts app or my app). What I would like to happen is that if they choose the stock app (where they can't really edit any data), they should be given an error that these contacts have to be edited using my custom app.

Or even better, if it's possible, make it so that if they try to edit one of the custm syched contacts, it should not even give them the choice to do it in the stock app (or any other app for that matter). Can they be tken directly to my contact editor app without being prompted to choose the app? And any other contacts could be opened using the stock app.

Thanks

kingston
  • 11,053
  • 14
  • 62
  • 116
user496854
  • 6,461
  • 10
  • 47
  • 84

1 Answers1

0

Please look here

You can add a profile action to the contact and from that you can open your application to edit the contact. In this case your application will be called directly.

Community
  • 1
  • 1
kingston
  • 11,053
  • 14
  • 62
  • 116
  • This still doesn't prevent the native contacts app from editing my contacts. I already created a custom field with a mime type for my custom contacts, and it set up my contact editor to launch when that field is clicked. What I need to happen is when the user tries to edit a contact, I want my app to pop up, not to even have the option to do it in the native app – user496854 Dec 14 '11 at 17:27
  • There is a new un-documented feature in honeycomb: it allows to set an activity to be used for editing or adding contact, please have a look here: http://stackoverflow.com/questions/8343372/honeycomb-sync-adapter-features-for-editing-contacts – kingston Feb 05 '12 at 12:18
  • It's no different than your previous answer. It doesn't prevent the stock editor from editing the app. you have to rely on the user to click the correct field – user496854 Feb 10 '12 at 05:47
  • I don't know how that feature work (it is undocumented and I did not go through the code yet) but I thought it was a way to specify which activity should be used for editing. In that case it should not make sense to allow the user choose the normal native app. Your activity should be considered part of the native app. – kingston Feb 10 '12 at 21:18
  • It actually works on 2.0 and higher, and there are a few examples of using it online -- it just creates an XML that tells the contacts up custom layout fields for your sync adapter. I'm already using it, and it basically creates a clickable field in the contact display that can be assigned its own activity to be launched. So, you can make a field called "edit contact", and it will launch the custom editor. – user496854 Feb 11 '12 at 19:12
  • mmm I'm using that method too. But that is something that was available on pre-honeycomb devices too. As stated in the forum by the google employee the new version should give you a "seamless integration". It is available on Honeycomb+ only. The idea is that your activity is used as part of the native address book instead of the default activity for editing – kingston Feb 13 '12 at 10:54
  • and you can use that activity to insert new contacts too: something you can't do by using profile actions. So clearly he is talking about something else. – kingston Feb 13 '12 at 17:57
  • Of course you can -- you can make it have any action by issuing the intent you want (including launching your own contact editor). So it's just the usual "custom field" setup in contacts – user496854 Feb 17 '12 at 06:23
  • But if the contact is not already there how can you have a profile action? A ptofile action is something you add in your contacts – kingston Feb 27 '12 at 20:16