0

I have created a layout file which needs to displayed when a menu item is pressed.

   public boolean onOptionItemSelected(MenuItem item){
    switch (item.getItemId()) {
              ....
       case R.id.help:
           return true;
             ......
    }
}

the help item menu should display the layout.xml file.

Akshay komarla
  • 722
  • 1
  • 11
  • 20

1 Answers1

1

You can use the layout in a new Activity. You can use Intent to invoke this new Activity,

Intent intent = new Intent(CurrentActivity.this, YourNewActivity.class);
startActivity(intent);

Or you can write a custom dialog to inflate the layout,

Android Custom Dialog Example

How to create a Custom Dialog box in android?

Community
  • 1
  • 1
K Neeraj Lal
  • 6,768
  • 3
  • 24
  • 33