inflate popup menu items programatically
<p>I have a button in my activity, pressing upon which, the following method gets called -</p>

<pre><code>private ArrayList&lt;ListView&gt; myListViewList;
private ArrayList&lt;MyListAdapter&gt; myAdapterList;

public void onPopupButtonClick(View button) {
    Log.v(TAG, "onPopupButtonClick");

    PopupMenu popup = new PopupMenu(this, button);
    Menu menu = popup.getMenu();

    // how do i display the myListViewList as items of in this popup menu
    // i.e how do i inflate myListViewList into menu object?

}
</code></pre>

<p>I know how to do this programatically for an activity - creating linearlayouts and listViews and finally using addContentView on the activity's context.</p>

<p>But finding it hard to do the same for the popup menu scenario as described above.</p>

<p>Any help is greatly appreciated.</p>

<p>TIA.</p>
