I have an application where user have few activities and transition is like
this

A -> B -> C -> and on D there is menu option Cancel(On Activity D) and at
that momemnt i want to go back to Activity A, but if user just click Back
button he should go back to C

>From C I called D like this
Class C extends ListActivity {
      public void onItemClick(AdapterView<?> parent, View view,
            int position, long id) {
            .......
            ........
           * startActivityForResult(intent,D_REQUEST); //D_REQUEST= 4
defined as int*
      }

//I expect this function of class C will be called when i exit from Activity
D
@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
       * if (resultCode == Activity.RESULT_CANCELED && requestCode ==
D_REQUEST) {
            this.finishActivity(Activity.C_REQUEST);// C_REQUEST= 4 defined
as int
        }
        super.onActivityResult(requestCode, resultCode, data);*
    }
}



>From D I exit like this
Class D extends ListActivity {
     @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        Order order = Order.getInstance();
        int itemId = item.getItemId();
        switch (itemId) {
        case R.id.summary:
            .....
            return true;
        case R.id.help:
            .....
            return true;
       * case R.id.cancelFullOrder:
            .....
            this.finishActivity(D_REQUEST);
            return true;*
        default:
            return super.onOptionsItemSelected(item);
        }
    }
}

*Problem :*Now my onActivityResult is never beign called when i execute code
of case R.id.cancelFullOrder, and also Activity D  doesnt get closed.

Could you please suggest something.

Thanks,
Ravi.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to