File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
OneSignalSDK/onesignal/src/main/java/com/onesignal Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -2169,20 +2169,16 @@ static void applicationOpenedByNotification(@Nullable final String notificationI
2169
2169
sessionManager .onDirectInfluenceFromNotificationOpen (appEntryState , notificationId );
2170
2170
}
2171
2171
2172
- static boolean startOrResumeApp (Activity inContext ) {
2173
- Intent launchIntent = inContext .getPackageManager ().getLaunchIntentForPackage (inContext .getPackageName ());
2174
- logger .debug ("startOrResumeApp from context: " + inContext + " isRoot: " + inContext .isTaskRoot () + " with launchIntent: " + launchIntent );
2175
- // Make sure we have a launcher intent.
2176
- if (launchIntent != null ) {
2177
- if (inContext .isTaskRoot ()) {
2178
- inContext .startActivity (launchIntent );
2179
- } else {
2180
- launchIntent .addFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
2181
- PendingIntent .getActivity (inContext , 0 , launchIntent , 0 );
2182
- }
2183
- return true ;
2184
- }
2185
- return false ;
2172
+ static boolean startOrResumeApp (Activity activity ) {
2173
+ Intent launchIntent = activity .getPackageManager ().getLaunchIntentForPackage (activity .getPackageName ());
2174
+ logger .debug ("startOrResumeApp from context: " + activity + " isRoot: " + activity .isTaskRoot () + " with launchIntent: " + launchIntent );
2175
+
2176
+ // Not all apps have a launcher intent, such as one that only provides a homescreen widget
2177
+ if (launchIntent == null )
2178
+ return false ;
2179
+
2180
+ activity .startActivity (launchIntent );
2181
+ return true ;
2186
2182
}
2187
2183
2188
2184
/**
You can’t perform that action at this time.
0 commit comments