[android-developers] Re: Photo Picker

2009-04-05 Thread Peli
Here is the solution: You have to move your cursor from position "-1" to "0" using moveToFirst(): android.database.Cursor cursor = activity.getContentResolver().query( intent.getData(), null, null, null, null); cursor.moveToFirst(); int idx = cursor.getColumnIndex(MediaStore.Image

[android-developers] Re: photo picker Uri issue

2009-04-01 Thread Streets Of Boston
You have to call moveToNext or moveToPosition first before you can use the cursor. On Apr 1, 2:13 pm, Bobbie wrote: > The exception is: > > 04-01 14:09:30.274: ERROR/AndroidRuntime(719): > java.lang.RuntimeException: Failure delivering result ResultInfo > {who=null, request=1, result=-1, data=In

[android-developers] Re: photo picker Uri issue

2009-04-01 Thread Bobbie
The exception is: 04-01 14:09:30.274: ERROR/AndroidRuntime(719): java.lang.RuntimeException: Failure delivering result ResultInfo {who=null, request=1, result=-1, data=Intent { data=content://media/ external/images/media/7 }} to activity {com.app.name/ com.app.name.activity}: android.database.Cur

[android-developers] Re: Photo Picker

2009-04-01 Thread Bobbie
Here's my debug errors: 04-01 10:01:33.318: ERROR/AndroidRuntime(30289): Uncaught handler: thread main exiting due to uncaught exception 04-01 10:01:33.418: ERROR/AndroidRuntime(30289): java.lang.RuntimeException: Failure delivering result ResultInfo {who=null, request=1, result=-1, data=Intent {

[android-developers] Re: Photo Picker

2009-04-01 Thread Bobbie
Any other ideas Boston? Eclipse won't even let me compile that code without putting it in debug mode, so there is something different in that code. Could you take another look? Thanks! On Mar 31, 5:57 pm, Bobbie wrote: > No, I have nothing in onPause().  I guess I'll just have to keep > pla

[android-developers] Re: photo picker Uri issue

2009-04-01 Thread Streets Of Boston
I can't tell. Debug your code and see which statement throws an exception and see what exception is thrown and note the values of the variables (are some set to null when they shouldn't, for example). On Apr 1, 9:35 am, Bobbie wrote: > I tried this code, and every time it force closes.  The Uri

[android-developers] Re: photo picker Uri issue

2009-04-01 Thread Bobbie
I tried this code, and every time it force closes. The Uri object gives me the Uri, but I can't see why it's failing... Please help!!! Uri photoUri = intent.getData(); Cursor cursor = getContentResolver().query(photoUri, new String[] {MediaStore.Images.ImageColumns.DATA}, null, null, null); Stri

[android-developers] Re: Photo Picker

2009-03-31 Thread Bobbie
No, I have nothing in onPause(). I guess I'll just have to keep playing with it. Bobbie On Mar 31, 4:05 pm, Streets Of Boston wrote: > Do you have code in your 'onPause()' method of your activity. > If so, it looks like this code is blocking (never returning). > > On Mar 31, 11:39 am, Bobbie

[android-developers] Re: Photo Picker

2009-03-31 Thread Streets Of Boston
Do you have code in your 'onPause()' method of your activity. If so, it looks like this code is blocking (never returning). On Mar 31, 11:39 am, Bobbie wrote: > When I choose the image, this is what I get in the debug log: > > 03-31 11:34:36.055: INFO/ActivityManager(55): Displayed activity > co

[android-developers] Re: Photo Picker

2009-03-31 Thread Bobbie
When I choose the image, this is what I get in the debug log: 03-31 11:34:36.055: INFO/ActivityManager(55): Displayed activity com.android.camera/.ImageGallery2: 2455 ms 03-31 11:34:39.525: VERBOSE/ImageGallery2(11143): / ImageBlockManager.onPause 03-31 11:34:49.519: WARN/ActivityManager(55): Lau

[android-developers] Re: Photo Picker

2009-03-31 Thread Streets Of Boston
Did you debug it? Did you get a null-pointer-exception? (The code i gave you may have some issues: I just typed it in, without using any IDE such as Eclipse. But it should give you a general idea of what to do) On Mar 30, 10:16 pm, Bobbie wrote: > I must have a bad phone or something...  Now th

[android-developers] Re: Photo Picker

2009-03-30 Thread Bobbie
I must have a bad phone or something... Now the program force closes on me? Here's what I have for "onActivityResult." Cursor cursor = getContentResolver().query(intent.getData(), null, null, null, null); int idx = cursor.getColumnIndex(ImageColumns.DATA); String fname = cursor.getString(idx);

[android-developers] Re: Photo Picker

2009-03-30 Thread Streets Of Boston
int idx = cursor.getColumnIndex(ImageColumn.DATA); String fname = cursor.getString(idx); On Mar 30, 7:45 pm, Bobbie wrote: > Wow... It's so simple, but still got an error... I got this: > > Cursor cursor = getContentResolver().query(datatoget, null, null, > null, null); > String fname = cursor.g

[android-developers] Re: Photo Picker

2009-03-30 Thread Bobbie
Wow... It's so simple, but still got an error... I got this: Cursor cursor = getContentResolver().query(datatoget, null, null, null, null); String fname = cursor.getString(ImageColumns.DATA); It won't let me run the code... "getString" is underlined in red and it just wants me to change it to "g

[android-developers] Re: Photo Picker

2009-03-30 Thread Streets Of Boston
This works as designed. The getDataString() is the string of the content Uri that refers to the image. If you want the physical filename, do a 'Cursor cursor = getContentResolver().query(intent.getData(), null, null, null, null)' and query the column ImageColumns.DATA on the returned cursor. The

[android-developers] Re: photo picker Uri issue

2009-03-26 Thread beachy
cheers, did not know that about Drawables will use Bitmaps then. Thanks, Greg. On Mar 25, 3:23 pm, Streets Of Boston wrote: > This Uri is the logical (not physical) path used by the image content > provider. > If you want to get the physical path to the actual file on the SD- > card, query this

[android-developers] Re: photo picker Uri issue

2009-03-25 Thread Streets Of Boston
This Uri is the logical (not physical) path used by the image content provider. If you want to get the physical path to the actual file on the SD- card, query this Uri: Cursor cursor = query(photoUri, new String[] {MediaStore.Images.ImageColumns.DATA}, null, null, null); String absoluteFilePa