I have an application, which (for the sake of simplicity) has two types of activities - Overview and DetailView. The Overview activity shows a list of steps and allows the user to start a DetailView activity corresponding to the step chosen.
In the DetailView activity, the user can start another Overview, which shows different steps than the ones in the parent of the current DetailView.
In the Overview, DetailView is started by using startActivityForResult (). In the DetailView, when the user decides to start a second Overview, I call setResult () and finish () and then start the new Overview. In this scenario, onActivityResult () and finishFromChild () do not fire. Instead, they fire when the parent finishes (!?).
I hope that this question isn't too stupid :)
Code from Overview:
Intent spIntent = new Intent ();
spIntent.setClassName ("com.testing.testa", "com.testing.testa.Overview");
spIntent.putExtra("id", itemId);
spIntent.putExtra("local", isLocal);
spIntent.putExtra("numberOfSteps", numberOfSteps);
spIntent.putExtra("currentStep", swipeStepNumber);
spIntent.putExtra("name", name);
System.out.println ("swipeStepNum: " + this.swipeStepNumber);
startActivityForResult (spIntent, 0);
...
public void onActivityResult (int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
System.out.pritnln ("Child ended with resultCode: " + resultCode); }
Code from DetailView:
Intent spIntent = new Intent ();
spIntent.setClassName ("com.testing.testa", "com.testing.testa.Overview");
spIntent.putExtra("id", itemId);
spIntent.putExtra("name", sectionedAdapter.getItem(position).toString());
startActivity (spIntent);
Intent die = new Intent ();
die.putExtra ("die", true);
setResult (1, die);
finish ();