2021年3月14日星期日

Getting Null Pointer Exception on method 'boolean java.util.Set.contains(java.lang.Object)'

The following code is causing Getting Null Pointer Exception on method 'boolean java.util.Set.contains(java.lang.Object)' Null Pointer Exception. I suspect

getIntent().getCategories().contains(Intent.CATEGORY_LAUNCHER)

is causing the problem. Couldn't reproduce the issue on any of my device but getting tons of crashes on Crashlytics. Any Idea what's happening?

private boolean hasPendingIntent() {          return getIntent() != null && getIntent().getCategories().contains(Intent.CATEGORY_LAUNCHER) && getIntent().getData() != null;      }  
https://stackoverflow.com/questions/66631771/getting-null-pointer-exception-on-method-boolean-java-util-set-containsjava-la March 15, 2021 at 10:50AM

没有评论:

发表评论