title: Setting EditText from selected item on ListView?
body: <p>I've been trying to set and EdiText on my activity when a ListView is called and an item is selected but everything I have tried doesn't work. How I have it setup is Main.class button opens ListView.class, iterm is slected on ListView and the sets EditText on Main.class with that value.</p>
  
  <p>Here is my code:</p>
  
  <p>Main.class:</p>
  
  <pre><code>public void onClick(View arg0) {
              // TODO Auto-generated method stub
              switch(arg0.getId()){
                  case R.id.bSetListItem:
                              Intent i = new Intent(getBaseContext(),
                                PhotoDialog.class);
                      startActivityForResult(i, GET_ITEM);
                      break;  
          }
          }
  
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data) 
       { 
           super.onActivityResult(requestCode, resultCode, data); 
  
           switch(requestCode) {
               case PICK_ITEM:
       // handle the contact result
                   Bundle extras = data.getExtras();
                   String val = extras.getString("item");
                   itemName.setText(val);
  
                   break;
           }
       }
  </code></pre>
  
  <p>ListView.class:</p>
  
  <pre><code>    public void onListItemClick(ListView parent, View v, int position,long id) {             
      Intent data = new Intent(this,Main.class);
  data.putExtra("key","SELECTED ITEM");    
  setResult(RESULT_OK, Intent data);
      }
  </code></pre>