get image from java,init sprite success,but after game pause ,the sprite turns black,why?

the image data is from a web site,and pass to c++ from java,here is the code:

CCImage ccimg;
if(!ccimg.initWithImageData((void**)iconbuffer,iconbufferlan,CCImage::kFmtPng))return;
CCTexture2D** texture = new CCTexture2D();
texture->initWithImage(&ccimg, kCCResolutionUnknown);
CCSprite* tempsssss = CCSprite::create(texture);

but after game pause ,it turns to black,anybody got the same problem?

You will need to reload it again as it is not cached.
When resuming all textures are reloaded. So you must add code to reload that image again.

Oren Bengigi wrote:

You will need to reload it again as it is not cached.
When resuming all textures are reloaded. So you must add code to reload that image again.

Thanks for replying ,but why it’s not same as the normal sprite ?
I tried to add the ccimg or the texture to texturecache but failed,I think maybe that’s the problem.

If you are using a regular sprite, using an image file,
when pause and resuming the app, Cocos2d-x reloads that image file back into a texture.

But since your image data is from the web, Cocos2d-x doesn’t know how to reload it,
so you need to implement it as it is not part of the framework.