How do I create a CCSprite from a photo picked from the photo library on Android?

Everything works fine on iOS. I use the media plugin to ask the user to pick a photo from their library. I then save that image to Environment.SpecialFolder.Personal. I read the raw byte[] from that file and feed it to CCTexture2D. I then create my CCSprite from the texture. This does not work on Android. Android never returns from the new CCTexture2D(byte[]) call with no exceptions. It just hangs.

If I give CCTexture2D a simple string, Android correctly finds the image sitting in the Assets/Content folder.

But I want to create a CCSprite out of a picture NOT from the Assets/Content folder.

Any suggestions?

Answers

Sign In or Register to comment.