title: Android: Passing Parameters Between Activities With Adapter
body: <p>Hope I'll succeed explain my situation the best.</p>
  
  <p>I have an Activity (A) which is basically a Form to add a new item, with few text fields, time and location field. 
  When clicking a setlocation button it invokes a second Activity (B) that has a list view with a customized ArrayAdapter which present suggestions for locactins. when clicking on one item (OnClickListener inside the adapter class) It need to pass it falue back to Activity A.</p>
  
  <p>Call Activity B from A</p>
  
  <pre><code>Intent I = new Intent(getApplicationContext(), TaskGeoSetActivity.class);
  startActivityForResult(I, LOC_ACTIVITY_CODE);
  </code></pre>
  
  <p>Setting the adapter inside Activity B</p>
  
  <pre><code>Adapter = new TaskGeoSubBaseAdapter(getApplicationContext(), R.id.sugtext, result);
  Adapter.setActivity(TaskGeoSetActivity.this);
  lv.setAdapter(Adapter);
  </code></pre>
  
  <p>OnClick Event within the adapter</p>
  
  <pre><code>public void setActivity(Activity act) {
      parentAct = act;
  }
  
  private final OnClickListener locpicker = new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Address a = items.get((Integer) v.getTag());
              Intent intent = new Intent(context, TaskAddActivity.class);
              intent.putExtra("Address", a);
              parentAct.setResult(parentAct.RESULT_OK, intent);
          }
  
  };
  </code></pre>