Here I got a Sub-activity ,in which there are two buttons,one is OK button,the other is Cancel button.
In the Subactivity Class, the Cancel button implemented as follows
- Code: Select all
cancel.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// Close this Activity
MySubActivity.this.setResult(RESULT_CANCELED);
MySubActivity.this.finish();
}
});
So when Cancel button been clicked, we got a RuntimeException:
Failure delivering result ResultInfo{who=null, request=1440, result=0, data=null, extras=null} to Original Activity: java.lang.NullPointerException
As far as I know, it seems that the cancel button didnt send back some arguments, which showed in ResultInfo, like who,result, data,extras. But Since the Cancel Button been CLICKed, why should send back the arguments?? OK, if follow the rules of API, what are needed and how to do this??
I got confused! Hope someone can HELP!!
Thanks!




