Skip to content

Commit

Permalink
Updated code based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Dec 20, 2023
1 parent dad3f90 commit 788d22a
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ private void requestNotificationPermission() {
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// Check if we are starting the activity from a link [Intent.ACTION_VIEW].
// This is invoked when a v2 link is opened.
/**
* Check if we are starting the activity from a link [Intent.ACTION_VIEW].
* This is invoked when a v2 link is opened.
*/
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
Uri uri = intent.getData();
// If the intent does not contain a link, do nothing.
Expand Down Expand Up @@ -220,10 +222,16 @@ protected void onNewIntent(Intent intent) {
}
}, this::fetchDescriptorComplete);
} else {
/**
* Check if we are starting the activity with an intent extra.
* This is invoked when we are starting the activity from a notification or
* when the activity is launched from the onboarding fragment
* @see {@link org.openobservatory.ooniprobe.fragment.onboarding.Onboarding3Fragment#masterClick}.
*/
if (intent.getExtras() != null) {
if (intent.getExtras().containsKey(RES_ITEM))
if (intent.getExtras().containsKey(RES_ITEM)) {
binding.bottomNavigation.setSelectedItemId(intent.getIntExtra(RES_ITEM, R.id.dashboard));
else if (intent.getExtras().containsKey(NOTIFICATION_DIALOG)) {
} else if (intent.getExtras().containsKey(NOTIFICATION_DIALOG)) {
new ConfirmDialogFragment.Builder()
.withTitle(intent.getExtras().getString("title"))
.withMessage(intent.getExtras().getString("message"))
Expand Down

0 comments on commit 788d22a

Please sign in to comment.