Create multiple context menus in one activity
<p>Hi I'm trying to make multiple context menus in one activity. 
There are two buttons, and I want to create different context menu for the each buttons. 
Could anyone advise me or refer me to some working examples?</p>

<p>Here is my current code looks like.</p>

<pre><code>registerForContextMenu(btn_1);
registerForContextMenu(btn_2);


btn_1.setOnClickListener(new View.OnClickListener() {

    public void onClick(View v) {

        openContextMenu(v);
    }   
});

btn_2.setOnClickListener(new View.OnClickListener() {

    public void onClick(View v) {

        openContextMenu(v);
    }   

});


    }

@Override
public void onCreateContextMenu(ContextMenu menu, View v,ContextMenu.ContextMenuInfo menuInfo) {
        super.onCreateContextMenu(menu, v, menuInfo);
        getMenuInflater().inflate(R.menu.media_menu, menu);
        menu.setHeaderTitle("Context menu for btn_1");
        menu.setHeaderIcon(R.drawable.icon_media_up); 
}

@Override
public boolean onContextItemSelected(MenuItem item) {
        switch(item.getItemId()) {
            case R.id.photo:
                Toast.makeText(this, "One", Toast.LENGTH_SHORT).show();
                return true;
            case R.id.video:
                Toast.makeText(this, "Two", Toast.LENGTH_SHORT).show();
                return true;
            case R.id.audio:
                Toast.makeText(this, "Three", Toast.LENGTH_SHORT).show();
                return true;
            }
        return super.onContextItemSelected(item);
    }
</code></pre>
