Hi Here is my code using cocos2d-X
void notify(){
CCLog("THE jni call is successfull 2");
CCNotificationCenter::sharedNotificationCenter()->postNotification(MY_SCREEN_RES,NULL);
}
extern "C" {
void Java_com_nbs_test_JNITest_printSomething(JNIEnv *, jclass){
CCLog("THE jni call is successfull");
notify();
}
}
The jni call is working fine, printing the message. In the constructor of my scene i use the following code
PingoScreen::PingoScreen() {
if (!CCLayer::init()) {
return;
}
CCNotificationCenter::sharedNotificationCenter()->addObserver(
this,
callfuncO_selector( PingoScreen::printSomethingInCpp),
"hello",
NULL);
My listner function is quite simple
void PingoScreen::printSomethingInCpp(){
CCLog("Its goton hererew---------------------------->");
}
This is never getting called. What am i doing wrong ?
Kind Regards