Fix regression: Unable to find explicit activity class
See https://github.com/TeamNewPipe/NewPipe/issues/3114#issuecomment-589940878 for info on this crash.
This reverts ef90493c27
partly.
This commit is contained in:
parent
5b98d41637
commit
0bc769b971
|
@ -55,7 +55,13 @@ public final class BackgroundPlayerActivity extends ServicePlayerActivity {
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,13 @@ public final class PopupVideoPlayerActivity extends ServicePlayerActivity {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPlayerOptionSelected(MenuItem item) {
|
public boolean onPlayerOptionSelected(MenuItem item) {
|
||||||
if (item.getItemId() == R.id.action_switch_background) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,13 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
||||||
startActivity(new Intent(Settings.ACTION_SOUND_SETTINGS));
|
startActivity(new Intent(Settings.ACTION_SOUND_SETTINGS));
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_switch_main:
|
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);
|
return onPlayerOptionSelected(item) || super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
@ -190,14 +196,7 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
.putExtra(BasePlayer.START_PAUSED, !this.player.isPlaying());
|
.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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue