prevent activityNotFound crash on calendar intent

This commit is contained in:
akaessens 2020-08-31 16:45:34 +02:00
parent d5e12c4d88
commit 643ac62788
1 changed files with 4 additions and 1 deletions

View File

@ -174,7 +174,10 @@ public class MainActivity extends AppCompatActivity {
// prepend url in description
String desc = event.url + "\n\n" + event.description;
intent.putExtra(CalendarContract.Events.DESCRIPTION, desc);
startActivity(intent);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
});