简体   繁体   中英

Android Studio not detecting changes

I am new to Android Java programming. Trying to make a simple app. All goes smootly until i want to add a menu... This is how i tried: After that I added the code

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}

No errors, but than any changes I do to menu_main.xml dont go to the app. After a lot of head-scraching i realised Android Studio doesnt read this file... The only way to force it to read the file is to "Reformat Code" on the entire app... Everytime i change this file i have to do it... Restarting Android Studio (even my PC and phone tbh) didnt work. Removing this file didnt help either (AS doesnt even notice the file is gone until I "Reformat Code"). Im guessing that because I manually add this file than it doesnt register as part of the app...? Any help would be appreciated. Thanks!

if You have problem's like that try to Rebuild Project ,

在此处输入图片说明

or remove folder ' projectname/app/build '. Temporary file build .

If that won't help You can Invalidate Caches/Restart

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM