title: How change position of popup menu on android overflow button?
body: <p>I just like to implement somethings same as popup menu in the Gmail app, anchored to the overflow button at the top-right. for that I used the same code as google tutorial for android <a href="http://developer.android.com/guide/topics/ui/menus.html#PopupMenu" rel="noreferrer">Android popup menu</a>, but for me show pop menu on top of edge of actionbar not under that. If you notice on pop menu of gmail overflow you saw that popmenu take place at edge of actionbar.</p>
  
  <p>This is the xml that I used for popup menu:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;item
          android:id="@+id/item1"
          android:title="lablab"/&gt;
      &lt;item
          android:id="@+id/item2"
          android:title="lablab"/&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>and at the follow is in my activity:</p>
  
  <pre><code>public void showFontSetting(View view) {
      PopupMenu popup = new PopupMenu(this, view);
      MenuInflater inflater = popup.getMenuInflater();
      inflater.inflate(R.menu.menu, popup.getMenu());
      popup.show();
  
      popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
  
          @Override
          public boolean onMenuItemClick(MenuItem item) {
          // TODO Auto-generated method stub
  
              switch (item.getItemId()) {
                  case R.id.item1:
                      Toast.makeText(Index.this,
                          "You Clicked : " + item.getTitle(),
                      Toast.LENGTH_SHORT).show();
                      break;
                  case R.id.item2:
                      break;
              }
              return true;
          }
      });
  }
  </code></pre>