开发者

Android - Screen Event

Can anyone tell me what event is fired when you come from Screen B to Screen A after pressing "BACK" button.

Screen A = 1st scre开发者_运维技巧en Screen B = 2nd screen

what event is fired when i come back to screen A from screen B.

*By Screen i mean Activity


No "events" are fired, just normal Activity lifecycle methods are called.


If you actually want to know when you come back from another Activity you have to start Activity B using startActivityForResult(intent, REQUEST_CODE)

And add this method to Activity A:

 protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
         if (requestCode == REQUEST_CODE) {

         } 
 }

In Activity B you can use setResult(RESULT_CODE) which you can then rad in onActivityResult using the resultCode.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜