Android Many Nested Activities Problem
I have an android application in which I have a ParentActivity class as follows.
public class ParentActivity extends Activity {
protected void navigateForResult(Context c, Class<?> destination, int requestCode) {
Intent i = new Intent(c, destination);
startActivityForResult(i, requestCode);
}
}
My all other activities are inherited from this activity. Now I have an activity called CategoryListActivity which is inherited from ParentActivity. The CategoryListActivity invokes another activity named SubCategoryListActivity using the function from ParentActivity named navigateForResult.
In SubCategoryListActivity I have following code in some event which is definitely fired开发者_如何学JAVA.
...
setResult(Activity.RESULT_OK, resultIntent);
finishActivity(5);
I also have onActivityResult function in CategoryListActivity but this is not fired. Am I doing anything wrong?
I figured out the bug. The finishActivity(with response code) doesn't really work. I have to use finish() instead
精彩评论