Technology

Create menu resource directory (res/menu) in Android Studio

Whenever you create a Blank Activity in Android Studio, a menu resource directory (i.e. menu resource file i.e. res/menu) and file gets automatically created, with auto-generated code in java class file. But what if you want to add an Empty Activity, can you create a menu resource directory and file manually? The answer is yes, this is what we will cover in this post.

What we will learn?

  • The difference between Blank Activity and Empty Activity?
  • How to add an Empty Activity in Android Studio?
  • How to create a menu resource directory (res/menu)?
  • How to create a menu resource file in menu resource directory (res/menu/menu_main.xml).

Here are the steps with which you can easily add a menu resource directory and file in Empty Activity in Android Studio,

Adding Menu Resource Directory (res/menu)

Step 1: Open your project and right click on res, then click “New”, then “Android resource directory”,

Figure 1- Add Android resource directoryFigure 1: Add Android resource directory

Step 2:

After that change the resource type to “menu” in the dropdown menu and then click “OK”

Figure 2- Change the resource type to menuFigure 2: Change the resource type to menu 

Step 3:

Read the complete article here: https://studyopedia.com/android/create-menu-resource-directory-res-menu-in-android-studio/

Comments

comments

thegenericwhiz@gmail.com'

GW Editorial Staff

Editorial Staff at Generic Whiz.

Leave a Reply

Your email address will not be published. Required fields are marked *