@tritzium posted a new topic, subject "Can't find layout.xml for Android". It read:

   I can't find the layout.xml used for cocos2d-x, it doesn't seem to be anywhere in proj.android, not in proj.android-studio and I can't find it in the cocos2d-x source directory. So where is the layout file stored?  
    I need this in order to prevent the screen from dimming, if there is any other way to do this I would be grateful to know.
    
    Thank you in advance!

To which @OscarLeif replied

    The layout is really a cocos2d-x surface object, but I guess everything is doing by code and the use of XML for the layout is not really necessary.

After which, @tritzium added

    Then where can I find the Activity java file so that I can make the screen stop dimming?

@OscarLeif replied

    @tritzium when you create a game using cocos2d-x you don't use Xml for layout why I don't really know, but the good thing is there's only one activity for your case maybe you just need to edit the file **AppActivity.java**  
    like this.
    [code] 
        public class AppActivity extends Cocos2dxActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState)
        {
            super.onCreate(savedInstanceState);
            Activity a = (Activity) getContext();
            a.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        }
        }
        
    [/code]
    
    I guess that's all you need. Basically what we did here is program on Android   
    Please tell if that works or not I not.

So @tritzium replied

    Yes, it worked. I was not aware that is what you are supposed to do if you want to change something specific to android.
    
    Thank you very much!

After which, @OscarLeif added

    Yes that is how you work on android.  
    You're welcome.


{'source': 'discourse', 'url': 'https://discuss.cocos2d-x.org/t/cant-find-layout-xml-for-android/28128', 'title': "Can't find layout.xml for Android", 'views': 1167, 'has_accepted_answer': False, 'word_count': 259, 'like_count': 0, 'reply_count': 3, 'participant_count': 2, 'posts': 6, 'tags': '', 'author': '@tritzium', 'participants': '@tritzium, @OscarLeif', 'image_url': [None], 'created_at': '2016-03-27T10:41:01.598Z', 'last_posted_at': '2016-03-28T18:41:03.879Z'}