In Android development, when the return key is pressed when the trigger condition is not met, it needs to be detected. In particular, the current activity requires a forward activity to deliver the message. That is, Activity1 jump to Activity3 if the use of startactivityforresult this way, if you do not rewrite the return key, the program does not know what to return to Activity1 what content will be an error. Therefore, you must rewrite the Activity3 's return key, and let him send an "ERROR" message here:
Copy Code code as follows:
@Override
public void onbackpressed () {
& nbsp; //TODO auto-generated method stub
Intent backintent = new Int ENT (Activity3.this, Activity1.class);
Bundle Bundle = new Bundle ();
if (!clickok)
bundle.putstring ("Send", "ERROR");
Backintent.putextras (bundle);
Activity3.this.setResult (1, backintent);
Activity3.this.finish ();
//super.onbackpressed ();
}