How enable/disable item in contextmenu
<p>I can disable a item in the contextmenu with this:</p>

<pre><code>menu.getItem(1).setEnabled(false);
</code></pre>

<p>in the onCreateContextMenu, but what if I later would like to set it to true within the same activity? How can I do that during runtime?</p>

<p>EDIT: </p>

<pre><code>        // Create context menu
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
        ContextMenuInfo menuInfo) {
    // TODO Auto-generated method stub
    super.onCreateContextMenu(menu, v, menuInfo);

    menu.setHeaderTitle("Options for this image"); // Title for the menu
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.activity_1_menu, menu);

    menu.getItem(1).setEnabled(false);  
}
</code></pre>

<p>This is where I want to change the item to enable:</p>

<pre><code>    // Handle return values from different activities
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == Activity.RESULT_OK) {

        if (requestCode == 1) {

            // Get value from intent
            String imageId = data.getExtras().getString("imageId");

            // Show full screen image
            Bitmap bitmap = BitmapFactory.decodeFile(imageId);
            imageView.setImageBitmap(bitmap);
        }

        else if(requestCode == 2) {
            String contact1 = data.getExtras().getString("contactName");
            String contact2 = data.getExtras().getString("test");
            Toast.makeText(Activity_1.this, "" + "Value from activity 3: " + contact1 + " " + contact2, Toast.LENGTH_SHORT).show();


 CHANGE MENU ITEM 1 TO ENABLE HERE!!!!

        }
    }
}
</code></pre>

<p>}</p>
