title: How to pass a custom layout to a PopupMenu?
body: <p>I want to customize the <code>popupmenu</code> in android, default popup menu gives more space ,so I'm trying to change the custom layout in popup menu but I cant figure out how.</p>
  
  <p><a href="https://i.stack.imgur.com/qoHPN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qoHPN.png" alt="enter image description here"></a></p>
  
  <p><strong>Note:</strong> I want to do this small popup design so I go with default popup menu but i want to customize it.</p>
  
  <pre><code>findViewById(R.id.menuclick).setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
          PopupMenu popupMenu = new PopupMenu(Sample1.this, view);
          popupMenu.setOnMenuItemClickListener(Sample1.this);
          popupMenu.inflate(R.layout.menus_layout);
          popupMenu.show();
      }
  });
  </code></pre>