Commit b6eabcb9 authored by fallenstardust's avatar fallenstardust

fix重复生命周期

parent ff1461de
...@@ -667,6 +667,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -667,6 +667,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
dialog.dismiss(); dialog.dismiss();
}); });
dialog.setRightButtonListener((dlg, s) -> { dialog.setRightButtonListener((dlg, s) -> {
dialog.dismiss();
ServerListAdapter mServerListAdapter = new ServerListAdapter(this); ServerListAdapter mServerListAdapter = new ServerListAdapter(this);
ServerListManager mServerListManager = new ServerListManager(this, mServerListAdapter); ServerListManager mServerListManager = new ServerListManager(this, mServerListAdapter);
mServerListManager.syncLoadData(); mServerListManager.syncLoadData();
...@@ -685,21 +686,10 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -685,21 +686,10 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
}).done((list) -> { }).done((list) -> {
if (list != null) { if (list != null) {
ServerInfo serverInfo = list.getServerInfoList().get(0); ServerInfo serverInfo = list.getServerInfoList().get(0);
duelIntent(this, serverInfo.getServerAddr(), serverInfo.getPort(), serverInfo.getPlayerName(), password); joinGame(serverInfo, password);
} }
}); });
}); });
} }
//决斗跳转
public static void duelIntent(Context context, String ip, int dk, String name, String password) {
Intent intent1 = new Intent("ygomobile.intent.action.GAME");
intent1.putExtra("host", ip);
intent1.putExtra("port", dk);
intent1.putExtra("user", name);
intent1.putExtra("room", password);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent1);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment