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!