call to OpenGL ES API with no current context (logged once per thread)

I go this error when inserting image for sdcard in cocos2dx

void AppDelegate::applicationWillEnterForeground() {
    CCDirector::sharedDirector()->startAnimation();
    // if you use SimpleAudioEngine, it must resume here
    // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
    HelloWorld hello;
    hello.addImageSprite();
}
const char * HelloWorld::addImageSprite(){
	JavaVM *jvm; //this is important to avoid threading errors
	thisEnv->GetJavaVM(&jvm); //this is important to avoid threading errors
	jvm->AttachCurrentThread(&thisEnv, 0); //this is important to avoid threading errors
		//jstring jstr = thisEnv->NewStringUTF("From jni");
	jclass cls = thisEnv->GetObjectClass(thisObj);
	jmethodID method = thisEnv->GetMethodID(cls, "getPath","()Ljava/lang/String;");
	jstring result = (jstring)thisEnv->CallObjectMethod(thisObj, method);
		// call the sayHello() method
	const char * string=thisEnv->GetStringUTFChars(result, 0);
	//CCMessageBox(string,"Alert");
	//if(string!=NULL){
		CCSprite* person = CCSprite::create(string);
		    //person->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
		person->setAnchorPoint(ccp(0, -.75));
		person->setPosition(ccp(0,0));
		    this->addChild(person,204);

	/*}else{
		CCLOG("%s","null");
	}*/
	return string;
}

i called hello.addImageSprite() in the appdelegate function because the function will be trigger after the user take a picture. I really need your brilliant idea…thank you in advance

@ranger You can not call opengl api directly in different thread

Can i ask for as simple tutorial in doing so sir yuye, because i am new to this. thank you