fengberd/PocketServer

Pocket server v 1.0.9.5 download process lost when switching to landscape mode.

Closed this issue · 1 comments

Expected behavior

while downloading the server, the ability to switch to landscape mode does not remove or cancel the server's ongoing download process.

Actual behavior

When the server downloading process is in progress, I do the screen orientation or switch to landscape display mode, suddenly the server download notification window visible on the android device screen automatically disappears, so that the download process is finished or running is unknowable.

How to reproduce

  1. open and launch the app
  2. click the top right shortcut
  3. Download server
  4. select one of the servers
  5. switch to landscape mode
  6. problems will appear

Browser: vivo yt53
Operating system: lollipop 6.0.1
App version: V 1.0.9.5

Recording Of The Bug

https://youtu.be/M9chlLU0hPg

Patched here(I tried DialogFragment but it doesn't work so I'll use this method instead):

main.setRequestedOrientation(getResources().getConfiguration().orientation==Configuration.ORIENTATION_PORTRAIT ? ActivityInfo.SCREEN_ORIENTATION_PORTRAIT : ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
processing_dialog.show();
new Thread(new Runnable()
{
public void run()
{
String[] wtf=nukkitMode ? jenkins_nukkit : jenkins_pocketmine;
wtf=wtf[p2].split("\\|");
main.downloadServer(wtf[1],new File(ServerUtils.getDataDirectory() + "/" + (nukkitMode ? "Nukkit.jar" : "PocketMine-MP.phar")),processing_dialog);
main.runOnUiThread(new Runnable()
{
public void run()
{
main.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);