How can make use of a variable inside a std:: function?


I have this std:: function that is std::able to receive a string from java side. But i’m just able to print the variable how can i use the string in the .cpp (update)?

std::string ofApp::getJavaString() {
	jmethodID midCallBackStatic = ofGetJNIEnv()->GetStaticMethodID(ofGetJavaOFAndroid(), "getStringToCppSide", "()Ljava/lang/String;");
	jstring resultJNIStr = (jstring)ofGetJNIEnv()->CallStaticObjectMethod(ofGetJavaOFAndroid(), midCallBackStatic);
	const char *resultCStr = ofGetJNIEnv()->GetStringUTFChars(resultJNIStr, NULL);
	std::string resultStr(resultCStr);
	ofGetJNIEnv()->ReleaseStringUTFChars(resultJNIStr, resultCStr);
	return resultStr;

Never used OF with Android but if you are able to print the variable you should also be able to store it in a ofApp::something and read the value in your ofApp::update()