Skip to content

Commit

Permalink
Attempt to resolve intents for external activities before trying to s…
Browse files Browse the repository at this point in the history
…tart them

Facebook is now attempting to force users to install the Facebook Messenger app by trying to start an activity with an implicit intent, which isn't found by the system and will crash if not handled properly.

Fixes #83
Fixes #84
  • Loading branch information
velazcod committed Feb 21, 2017
1 parent a0b232c commit 6e98979
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,10 @@ public void openExternalSite(String url) {
// This link is not for a page on my site, launch another Activity
// that handles this URL
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);

if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}

/**
Expand Down

0 comments on commit 6e98979

Please sign in to comment.