Merge pull request #805 from karyogamy/notification-controls-intent-fix

Fixes Open Control intent exception between SDK 21 and 24
This commit is contained in:
Christian Schabesberger 2017-11-01 01:37:15 +01:00 committed by GitHub
commit e8ea1c92b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -132,8 +132,8 @@ public final class BackgroundPlayer extends Service {
//////////////////////////////////////////////////////////////////////////*/
public void openControl(final Context context) {
final Intent intent = new Intent(context, BackgroundPlayerActivity.class);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Intent intent = new Intent(context, BackgroundPlayerActivity.class);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
context.startActivity(intent);

View file

@ -314,8 +314,8 @@ public final class PopupVideoPlayer extends Service {
}
public void openControl(final Context context) {
final Intent intent = new Intent(context, PopupVideoPlayerActivity.class);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Intent intent = new Intent(context, PopupVideoPlayerActivity.class);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
context.startActivity(intent);