Popup menu crash at show();
<p>So I'm trying to create a popup menu which will popup when user presses on ImageButton.</p>

<p>I'm getting strange force close error on <code>popupMenu.show()</code>:</p>

<pre><code>case R.id.action_menu_edit_biljeske_uredi:
  linearLayoutDodajBiljeskuBojeIOstalaSranja.setVisibility(View.VISIBLE);
  imageButtonBiljeskeDodajBiljeskuBojaPozadine
    = (ImageButton) findViewById(R.id.imageButtonBiljeskeDodajBiljeskuBojaPozadine);
  imageButtonBiljeskeDodajBiljeskuBojaPozadine.setOnClickListener(
    new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        PopupMenu popupMenu = new PopupMenu(getApplicationContext(),
                                            imageButtonBiljeskeDodajBiljeskuBojaPozadine);
        popupMenu.getMenuInflater().inflate(R.menu.menu_popup_biljeske_boje,
                                            popupMenu.getMenu());
        popupMenu.show();
      }
    });
}
</code></pre>

<p>Does anyone know why?</p>

<h2>Logcat</h2>

<pre><code>04-12 20:22:27.847 24594-24594/com.daroioradecic.studyandexamplannerbydario E/AndroidRuntime:
  FATAL EXCEPTION: main
  Process: com.daroioradecic.studyandexamplannerbydario, PID: 24594
  java.lang.RuntimeException: Failed to resolve attribute at index 6
      at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:603)
      at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:6474)
      at android.view.ViewGroup$MarginLayoutParams.&lt;init&gt;(ViewGroup.java:6642)
      at android.widget.FrameLayout$LayoutParams.&lt;init&gt;(FrameLayout.java:741)
      at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:685)
      at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:62)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
      at android.support.v7.view.menu.MenuPopupHelper$MenuAdapter.getView(MenuPopupHelper.java:374)
      at android.support.v7.view.menu.MenuPopupHelper.measureContentWidth(MenuPopupHelper.java:223)
      at android.support.v7.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:157)
      at android.support.v7.view.menu.MenuPopupHelper.show(MenuPopupHelper.java:129)
      at android.support.v7.widget.PopupMenu.show(PopupMenu.java:216)
      at com.daroioradecic.studyandexamplannerbydario.BiljeskeDodajBiljesku$2.onClick(BiljeskeDodajBiljesku.java:106)
      at android.view.View.performClick(View.java:4856)
      at android.view.View$PerformClick.run(View.java:19956)
      at android.os.Handler.handleCallback(Handler.java:739)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:211)
      at android.app.ActivityThread.main(ActivityThread.java:5389)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
</code></pre>

<h2>Menu</h2>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item
        android:icon="@drawable/ic_action_crvena"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeCrvena"/&gt;
    &lt;item
        android:icon="@drawable/ic_action_ljubicasta"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeLjubicasta"/&gt;
    &lt;item
        android:icon="@drawable/ic_action_svijetloplava"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeSvijetloPlava"/&gt;
    &lt;item
        android:icon="@drawable/ic_action_tamnoplava"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeTamnoPlava"/&gt;
    &lt;item
        android:icon="@drawable/ic_action_zelena"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeZelena"/&gt;
    &lt;item
        android:icon="@drawable/ic_action_usranozuta"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeUsranoZuta"/&gt;
    &lt;item
        android:icon="@drawable/ic_action_narancasta"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeNarancasta"/&gt;
    &lt;item
        android:icon="@drawable/ic_action_siva"
        android:title=""
        android:id="@+id/popupMenuBiljeskeBojeSiva"/&gt;
&lt;/menu&gt;
</code></pre>