|
|
@ -59,6 +59,18 @@ public class MainActivity extends BaseActivity {
|
|
|
|
List<TeamBeen> teamBeens = gson.fromJson(gson.toJson(response.body().getData()), new TypeToken<List<TeamBeen>>() {
|
|
|
|
List<TeamBeen> teamBeens = gson.fromJson(gson.toJson(response.body().getData()), new TypeToken<List<TeamBeen>>() {
|
|
|
|
}.getType());
|
|
|
|
}.getType());
|
|
|
|
user.setTeamBeens(teamBeens);
|
|
|
|
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();
|
|
|
|
getPda();
|
|
|
@ -125,10 +137,10 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
|
|
// 登录
|
|
|
|
// 登录
|
|
|
|
public void login(View view) {
|
|
|
|
public void login(View view) {
|
|
|
|
// if (!loginState) {
|
|
|
|
if (!loginState) {
|
|
|
|
// Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show();
|
|
|
|
Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show();
|
|
|
|
// return;
|
|
|
|
return;
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
String teamCode = user.getTeamCode();
|
|
|
|
String teamCode = user.getTeamCode();
|
|
|
|
if (teamCode==null||teamCode.isEmpty()) return;
|
|
|
|
if (teamCode==null||teamCode.isEmpty()) return;
|
|
|
|
dialog.show();
|
|
|
|
dialog.show();
|
|
|
|