[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread kingkung
Cool, gotcha, thanks. On Aug 27, 5:12 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote: > You don't need to manually type the uris.. as I said before you can use > ContentUris.withAppendedId(People.CONTENT_URI, ) > > More in the docs/examples > here:http://code.google.com/android/devel/data/contentpr

[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread Megha Joshi
You don't need to manually type the uris.. as I said before you can use ContentUris.withAppendedId(People.CONTENT_URI, ) More in the docs/examples here: http://code.google.com/android/devel/data/contentproviders.html Most of the times you could get the base URIs and use withApendedPath() or withA

[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread kingkung
Got it, thanks. I just did Uri.parse() on that a string containing "content://...". It would certainly be nice if we didn't have to manually type that entire URI address in... some way we could access the ENTIRE Uri for People, Phones, etc. Even referencing People.CONTENT_URI.getPath() fails to

[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread Megha Joshi
Yes it would crash, because then the Uri value you get does not include the base contacts uri...which is content://contacts. The uri value should be something like: content://contacts/people/ As long as the Uri value is in this format and the person_id is present in the content provider it should

[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread kingkung
If you try that code in your demo (and print out the Uri for debugging), it will crash with a null pointer exception. I also tried using Uri.Builder to rebuild the contact Uri, and that didn't work either. On Aug 27, 4:31 pm, kingkung <[EMAIL PROTECTED]> wrote: > /people/189 is the uri i get. >

[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread kingkung
/people/189 is the uri i get. On Aug 27, 4:24 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote: > You definitely don't need to store the URI, what are the first and second > URI values that you get? > > 2008/8/27 kingkung <[EMAIL PROTECTED]> > > > > > I added one simple line to the demo and it crashed

[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread Megha Joshi
You definitely don't need to store the URI, what are the first and second URI values that you get? 2008/8/27 kingkung <[EMAIL PROTECTED]> > > I added one simple line to the demo and it crashed with a null pointer > exception. Apparently I can't recreate a second Uri from an original > Uri. > >

[android-developers] Re: issues with setPhotoData() and loadContactPhoto()

2008-08-27 Thread kingkung
I added one simple line to the demo and it crashed with a null pointer exception. Apparently I can't recreate a second Uri from an original Uri. private void readContact(Uri uri) { ImageView i = (ImageView) findViewById(R.id.image); Uri uri2 = Uri.parse(uri.getEncodedPath()); Bitma