Commit b7547be8 authored by fallenstardust's avatar fallenstardust

只在加入服务器时显示tips

parent e581b132
...@@ -158,12 +158,6 @@ public class YGOStarter { ...@@ -158,12 +158,6 @@ public class YGOStarter {
//显示加载背景 //显示加载背景
showLoadingBg(activity); showLoadingBg(activity);
Log.e("YGOStarter", "设置背景后" + System.currentTimeMillis()); Log.e("YGOStarter", "设置背景后" + System.currentTimeMillis());
/* if (!ComponentUtils.isActivityRunning(activity, new ComponentName(activity, YGOMobileActivity.class))) {
String[] tipsList = activity.getResources().getStringArray(R.array.tips);
int x = (int) (Math.random() * tipsList.length);
String tips = tipsList[x];
Toast.makeText(activity, tips, Toast.LENGTH_LONG).show();
}*/
} }
Intent intent = new Intent(activity, YGOMobileActivity.class); Intent intent = new Intent(activity, YGOMobileActivity.class);
if (options != null) { if (options != null) {
......
...@@ -475,6 +475,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -475,6 +475,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
} }
void joinGame(ServerInfo serverInfo, String name) { void joinGame(ServerInfo serverInfo, String name) {
showTipsToast();
YGOGameOptions options = new YGOGameOptions(); YGOGameOptions options = new YGOGameOptions();
options.mServerAddr = serverInfo.getServerAddr(); options.mServerAddr = serverInfo.getServerAddr();
options.mUserName = serverInfo.getPlayerName(); options.mUserName = serverInfo.getPlayerName();
...@@ -669,4 +670,13 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -669,4 +670,13 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
return; return;
CardDetailRandom.RandomCardDetail(this, cardInfo); CardDetailRandom.RandomCardDetail(this, cardInfo);
} }
public void showTipsToast() {
if (!ComponentUtils.isActivityRunning(this, new ComponentName(this, YGOMobileActivity.class))) {
String[] tipsList = this.getResources().getStringArray(R.array.tips);
int x = (int) (Math.random() * tipsList.length);
String tips = tipsList[x];
Toast.makeText(this, tips, Toast.LENGTH_LONG).show();
}
}
} }
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