startActivityForResult doesn't seem to call onActivityResult
<p>When The user Click on the button it want to call the dialog- that dialog contain list of product in ListView.After user slect the product it should come to previuous activity.</p>

<p>I have done using <code>startActivityForResult ()</code>.</p>

<p>There aresome issue.My calling activity is in normal tab activity that normal tab activty in Tab Activity Group.</p>

<p>Actualy i want to do in drrop down(Spinner).In my scanerio i couldn't get context.It awalys give <code>Android Spinner Error : android.view.WindowManager$BadTokenException: Unable to add window</code></p>

<p>So I have change to my design like this: When User click buttion it load the list of product in ListView.After pick the product, it come back to previous activity.</p>

<p><a href="http://stackoverflow.com/questions/7609519/android-spinner-error-android-view-windowmanagerbadtokenexception-unable-to-a">This is my previous question : link</a></p>

<p>Here calling activity:</p>

<pre><code>  //Click Product button
   l_prod.setOnClickListener(new OnClickListener() {
       public void onClick(View v) {
            Intent showContent = new Intent(LineDiscountActivity.this,ListProductActivity.class);
            Bundle bundle = new Bundle();
            bundle.putString("Activity", "LineDiscountActivity");
            bundle.putString("RetailerName", retailerName);
            bundle.putString("RetailerCode", retailerCode);
            showContent.putExtra("discountProduct", discountList);
            showContent.putExtras(bundle);
            getParent().startActivityForResult(showContent, 5);
       }
   });
</code></pre>

<p>And my receiver activity    :</p>

<pre><code>  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
        super.onListItemClick(l, v, position, id);
            Object o = this.getListAdapter().getItem(position);
            String book = o.toString();
            Intent i = new Intent();
            Bundle bundle = new Bundle();
            bundle.putString("Activity", "ListProductActivity");
            bundle.putString("RetailerName", retailerName);
            bundle.putString("RetailerCode", retailerCode);
            bundle.putString("seletcedProductCode", products.get(position).getProductCode());
            bundle.putString("seletcedProductName", products.get(position).getDescription());
            bundle.putDouble("seletcedProductQty", products.get(position).getAvailableQuantity());
            i.putExtra("discountProduct", discountList);
            i.putExtras(bundle);
            if (getParent() == null) {
                setResult(Activity.RESULT_OK, i);
            } else {
                getParent().setResult(Activity.RESULT_OK, i);
            }
            ListProductActivity.this.finish(); 

    }
</code></pre>

<p>And calling activity </p>

<pre><code> @Override
protected  void onActivityResult(int requestCode, int resultCode, Intent data) {
//  super.onActivityResult(requestCode, resultCode, data);
    Log.i("-requestCode from LineDisocunt--" ,"" + requestCode);

}
</code></pre>

<p>I have written this code(<code>onActivityResult</code>) in calling activity &amp; Tab main Activty also.</p>

<p>I didn't go anywhere..</p>

<p>onActivityResult mehtod.But it didn't go it.</p>

<p>What is wrong in my code.</p>

<p>Please let me know if anybody know this...</p>

<p>Thanks in advance</p>
