-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hisyam
committed
Feb 8, 2021
1 parent
5710472
commit 6ed2630
Showing
5 changed files
with
129 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
MOLPayReactExampleProject/android/app/src/main/java/com/test0270/DeepLinkActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.test0270; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
|
||
public class DeepLinkActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
if (isTaskRoot()) { | ||
// This Activity is the only Activity, so | ||
// the app wasn't running. So start the app from the | ||
// beginning (redirect to MainActivity) | ||
Intent intent = getIntent(); // Copy the Intent used to launch me | ||
// Launch the real root Activity (launch Intent) | ||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); | ||
intent.setClass(this, MainActivity.class); | ||
// I'm done now, so finish() | ||
|
||
startActivity(intent); | ||
finish(); | ||
} else { | ||
// App was already running, so just finish, which will drop the user | ||
// in to the activity that was at the top of the task stack | ||
finish(); | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters