The openAssetFile() call should have thrown before that, since only reading "r" is supported.
Also, keep in mind that the Uri structure that provides vCards in this formant is not part of public API. You should be treating the Uri handed to you by ACTION_SEND as an opaque Uri, as its format may change in the future. j On Mon, Dec 7, 2009 at 8:26 PM, Molee <[email protected]> wrote: > I can successfully retrieve a FileInputStream with this uri > as follows > > Uri myPerson = Uri.withAppendedPath > (ContactsContract.Contacts.CONTENT_VCARD_URI, iLookKey); > AssetFileDescriptor afd =this.getContentResolver > ().openAssetFileDescriptor(myPerson, "r"); > > > FileInputStream fis = afd.createInputStream(); > > > However, when I wanna input a vcard to change the content of a > contact > as follows > > Uri myPerson = Uri.withAppendedPath > (ContactsContract.Contacts.CONTENT_VCARD_URI, iLookKey); > AssetFileDescriptor afd = this.getContentResolver > ().openAssetFileDescriptor(myPerson, "w"); > FileOutputStream fos = afd.createOutputStream(); > > IOException is caught in the line of "FileOutputStream fos = > afd.createOutputStream();". > and it said that "unable to seek" > > I believe that that's no problem about Lookup key . > Could anyone tell me what's wrong with the exception caught??? > I need to restore some vcard in codes yet I dun wanna breakdown the > content of vcard by categorys. > Thank You~~ > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Jeff Sharkey [email protected] -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

