How to differentiate From Which Activity the current intent comes

前端 未结 3 841
情深已故
情深已故 2021-01-25 15:35

Form Activity Login I call

Intent intent=new Intent(LogIn.this,BRInfoActivity.class);

From Activity BrActivityList I Call

Inten         


        
3条回答
  •  太阳男子
    2021-01-25 16:09

    May this help you...

    The new intent comes as part of onNewIntent(Intent). The original Intent is still available via getIntent().

    You put whatever code you need to into onNewIntent in order to update the UI with the new parameters; probably similar to what you're doing in onCreate.

    Also, you probably want to call setIntent(intent) in onNewIntent to make sure future calls to getIntent() within the Activity lifecycle get the most recent Intent data.

提交回复
热议问题