Skip to content

Commit

Permalink
Fix regression: Unable to find explicit activity class
Browse files Browse the repository at this point in the history
See #3114 (comment) for info on this crash.
This reverts ef90493 partly.
  • Loading branch information
TobiGr committed Feb 22, 2020
1 parent 5b98d41 commit 0bc769b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ public boolean onPlayerOptionSelected(MenuItem item) {
return true;
}

return switchTo(PopupVideoPlayer.class);
this.player.setRecovery();
getApplicationContext().sendBroadcast(getPlayerShutdownIntent());
getApplicationContext().startService(
getSwitchIntent(PopupVideoPlayer.class)
.putExtra(BasePlayer.START_PAUSED, !this.player.isPlaying())
);
return true;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ public int getPlayerOptionMenuResource() {
@Override
public boolean onPlayerOptionSelected(MenuItem item) {
if (item.getItemId() == R.id.action_switch_background) {
return switchTo(BackgroundPlayer.class);
this.player.setRecovery();
getApplicationContext().sendBroadcast(getPlayerShutdownIntent());
getApplicationContext().startService(
getSwitchIntent(BackgroundPlayer.class)
.putExtra(BasePlayer.START_PAUSED, !this.player.isPlaying())
);
return true;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
startActivity(new Intent(Settings.ACTION_SOUND_SETTINGS));
return true;
case R.id.action_switch_main:
return switchTo(MainVideoPlayer.class);
this.player.setRecovery();
getApplicationContext().sendBroadcast(getPlayerShutdownIntent());
getApplicationContext().startActivity(
getSwitchIntent(MainVideoPlayer.class)
.putExtra(BasePlayer.START_PAUSED, !this.player.isPlaying())
);
return true;
}
return onPlayerOptionSelected(item) || super.onOptionsItemSelected(item);
}
Expand All @@ -190,14 +196,7 @@ protected Intent getSwitchIntent(final Class clazz) {
false,
false
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.putExtra(BasePlayer.START_PAUSED, !this.player.isPlaying());
}

protected boolean switchTo(final Class clazz) {
this.player.setRecovery();
getApplicationContext().sendBroadcast(getPlayerShutdownIntent());
getApplicationContext().startActivity(getSwitchIntent(clazz));
return true;
.putExtra(BasePlayer.START_PAUSED, !this.player.isPlaying());
}

////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 0bc769b

Please sign in to comment.