title: Retrieving text from a ListView item with OnContextItemSelected
body: <p>I've a ListView with a 'classic' context menu with delete and similar options. Since I'm deleting from a SharedPreferences object, I need to retrieve the key, which is the text set into ListView's items.</p>
  
  <p>I've tried the following code:</p>
  
  <pre><code>    @Override
      public boolean onContextItemSelected(MenuItem item){
          AdapterContextMenuInfo saved = (AdapterContextMenuInfo) item.getMenuInfo();
  
          TextView view = (TextView)findViewById((int) saved.id);
  
          Log.d("DEBUG:", "before key");
          String key = view.getText().toString();
          Log.d("DEBUG:", "after...");
  
          switch (item.getItemId()){
              case R.id.conmenu_delete:
                  return true;
  
              case R.id.conmenu_copy:
                  return true;
  
              case R.id.conmenu_send:
                  return true;
  
              default:
                  return super.onContextItemSelected(item);
          }
      }
  </code></pre>
  
  <p>But, unfortunately, it crashes while trying to retrieve the text from the View, as I know from logs.</p>