title: Android popup menu is not anchored to button on Action bar
body: <p>I've a problem to create a popup menu on Android. Pratically, I want to load dynamically the popup but when I execute the app, the menu is out of screen and doesn't anchored on button...why?</p>
  
  <p>This is a screen to understand: </p>
  
  <p><img src="https://i.stack.imgur.com/ZCxEy.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/1hahA.png" alt="enter image description here"></p>
  
  <p>This is a summary code that I use to create my popupmenu:</p>
  
  <pre><code>public class MainActivity extends FragmentActivity
  {
      PopupMenu select_job;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) 
      {
           //...
           View view = inflater.inflate(R.layout.my_custom_layout ,null);
           select_job = new PopupMenu(this, view);
           select_job.getMenu().add("ProvaLavoro");
      }
  
      public boolean onOptionsItemSelected(MenuItem item)
      {
          switch(item.getItemId())
          {
              case R.id.popupmenu:
                  select_job.show();
                  break;
          }
      }
  }
  </code></pre>
  
  <p>This is my_custom_layout.xml to inflate whitin:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;TextView
          android:id="@+id/txtNameJobND"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:padding="0dp"
          android:textColor="#111"
          android:textStyle="bold"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks!!</p>