|
|
|
@ -59,6 +59,18 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
List<TeamBeen> teamBeens = gson.fromJson(gson.toJson(response.body().getData()), new TypeToken<List<TeamBeen>>() {
|
|
|
|
|
}.getType());
|
|
|
|
|
user.setTeamBeens(teamBeens);
|
|
|
|
|
String teamName = SharedPreferencesUtils.getstring("teamName", null);
|
|
|
|
|
if (teamName!=null){
|
|
|
|
|
TeamBeen teamBeen=new TeamBeen();
|
|
|
|
|
teamBeen.setTeamName(teamName);
|
|
|
|
|
int position = teamBeens.indexOf(teamBeen);
|
|
|
|
|
Log.e("TAG", "记录位置:" +position );
|
|
|
|
|
binding.loginTeamSpinner.post(new Runnable() {
|
|
|
|
|
public void run() {
|
|
|
|
|
binding.loginTeamSpinner.setSelection(position);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
getPda();
|
|
|
|
@ -125,10 +137,10 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
// 登录
|
|
|
|
|
public void login(View view) {
|
|
|
|
|
// if (!loginState) {
|
|
|
|
|
// Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show();
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if (!loginState) {
|
|
|
|
|
Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String teamCode = user.getTeamCode();
|
|
|
|
|
if (teamCode==null||teamCode.isEmpty()) return;
|
|
|
|
|
dialog.show();
|
|
|
|
|