Why Menu dosen't work in my helloworld project?

Why Menu dosen't work in my helloworld project?
0.0 0


I build a simple android project under Ubuntu,Android SDK 2.2,Android NDK r7.It is built well ,but I found that the exit menu(X) at the right-down corner does not response when i touch on it.By the way , the touch event works well in a Layer.So I think there may be something I do not know about a Menu or Selector,or whatever sth else.Please help!


Can “Tests” works correctly? It use menu item to enter different test cases.


Oh my god! I even found that not the ‘X’ button but the items in the project ‘TestsDemo’ cann’t be clicked,they have no any response!What I do is just compile the project and import the android project with Eclipse,changing mini-SDK-version ‘7’ to ‘8’ because I only have android-8 SDK.Then I run the project.Is there anything else I have to do?By the way,cocos2d-x works well on my WIN32.


Same issue here, got this code working as intended on iOS but button is not active(does not respond to tap) on android devices ( GS1,GS2, Xoom )

    CCLabelTTF* pLabel = CCLabelTTF::labelWithString("Restart", "Arial", 20);
    CCMenuItemLabel* pMenuItem = CCMenuItemLabel::itemWithLabel(pLabel, this, menu_selector(HelloWorld::menuRestartCallback));
    CCMenu* pMenu = CCMenu::menuWithItems(pMenuItem, NULL);
    pMenu->setPosition( CCPointZero );
    pMenuItem->setPosition( CCPointMake( screenSize.width - 50, 55) );
    addChild(pMenu, 1);

With handler:

void HelloWorld::menuRestartCallback(CCObject* sender){
    CCLog("Restart button tapped. Respawning player.");


Why did you say button is not active?
You didn’t see the log?

Does HelloWorld or tests work correctly?


Item menu does not respond to tap on Android devices, but works fine on iOS. By works fine I intend that callback function is called.
In tests.android menu items do not respond to tap either. I can scroll the menu but can not select test.
SDK 2.2 and NDK 7, testing on devices: Galaxy S1, Xoom, Nexus S same result on all of them :frowning:

Yet screen touch events are fired by android, I can see them in logcat:

01-11 17:52:05.702: I/InputReader(178): dispatchTouch::touch event’s action is 1

Seems like touches are not dispatched to menu items.