File tree Expand file tree Collapse file tree
app/src/main/java/one/mixin/android/ui/home/web3/trade Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package one.mixin.android.ui.home.web3.trade
22
3+ import android.app.Activity
34import android.content.Context
45import android.content.Intent
56import android.os.Bundle
@@ -34,6 +35,9 @@ class SwapActivity : BaseActivity(){
3435 ) {
3536 context.startActivity(
3637 Intent (context, SwapActivity ::class .java).apply {
38+ if (context !is Activity ) {
39+ addFlags(Intent .FLAG_ACTIVITY_NEW_TASK )
40+ }
3741 input?.let { putExtra(ARGS_INPUT , it) }
3842 output?.let { putExtra(ARGS_OUTPUT , it) }
3943 amount?.let { putExtra(ARGS_AMOUNT , it) }
@@ -43,7 +47,7 @@ class SwapActivity : BaseActivity(){
4347 entrySource?.let { putExtra(TradeFragment .ARGS_ENTRY_SOURCE , it) }
4448 entryType?.let { putExtra(TradeFragment .ARGS_ENTRY_TYPE , it) }
4549 initialTab?.let { putExtra(ARGS_INITIAL_TAB , it) }
46- flags = Intent .FLAG_ACTIVITY_SINGLE_TOP or Intent .FLAG_ACTIVITY_CLEAR_TOP
50+ addFlags( Intent .FLAG_ACTIVITY_SINGLE_TOP or Intent .FLAG_ACTIVITY_CLEAR_TOP )
4751 },
4852 )
4953 }
Original file line number Diff line number Diff line change 11package one.mixin.android.ui.home.web3.trade.perps
22
3+ import android.app.Activity
34import android.content.Context
45import android.content.Intent
56import android.os.Bundle
@@ -71,6 +72,9 @@ class PerpsActivity : BaseActivity() {
7172 source : String? = null,
7273 ) {
7374 val intent = Intent (context, PerpsActivity ::class .java).apply {
75+ if (context !is Activity ) {
76+ addFlags(Intent .FLAG_ACTIVITY_NEW_TASK )
77+ }
7478 addFlags(Intent .FLAG_ACTIVITY_SINGLE_TOP )
7579 putExtra(EXTRA_MARKET_ID , marketId)
7680 putExtra(EXTRA_MARKET_SYMBOL , marketSymbol)
@@ -92,6 +96,9 @@ class PerpsActivity : BaseActivity() {
9296 source : String ,
9397 ) {
9498 val intent = Intent (context, PerpsActivity ::class .java).apply {
99+ if (context !is Activity ) {
100+ addFlags(Intent .FLAG_ACTIVITY_NEW_TASK )
101+ }
95102 addFlags(Intent .FLAG_ACTIVITY_SINGLE_TOP )
96103 putExtra(EXTRA_MARKET_ID , marketId)
97104 putExtra(EXTRA_MARKET_SYMBOL , marketSymbol)
You can’t perform that action at this time.
0 commit comments