fix bug 修改Json传递失败问题
This commit is contained in:
@@ -48,7 +48,7 @@ android {
|
||||
*/
|
||||
// buildConfigField("String", "SERVER_IP", "\"120.27.209.4\"")
|
||||
// buildConfigField("String", "SERVER_PORT", "\"56792\"")
|
||||
buildConfigField("String", "SERVER_IP", "\"192.168.0.108\"")
|
||||
buildConfigField("String", "SERVER_IP", "\"192.168.0.105\"")
|
||||
buildConfigField("String", "SERVER_PORT", "\"56792\"")
|
||||
/**
|
||||
* 门禁连接地址
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.ydd.sportfaceid.netty.message;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class MessageDTO implements Serializable {
|
||||
|
||||
@Expose
|
||||
private MessageType messageType;
|
||||
@Expose
|
||||
private String message;
|
||||
|
||||
public MessageDTO(MessageType messageType, String message) {
|
||||
|
||||
@@ -79,9 +79,6 @@ public class SDSettingActivity extends SDBaseActivity {
|
||||
e.printStackTrace();
|
||||
}
|
||||
resultList = JsonMapper.fromJson(result,new TypeToken<List<VenueItem>>(){}.getType());
|
||||
List<VenueItem> objectList = new Gson().fromJson(result, new TypeToken<List<VenueItem>>(){}.getType());
|
||||
System.out.println(resultList.get(0).getVenueId());
|
||||
System.out.println(objectList.get(0).getVenueId());
|
||||
Message message = new Message();
|
||||
message.what = 1;
|
||||
handler.sendMessage(message);
|
||||
@@ -115,7 +112,6 @@ public class SDSettingActivity extends SDBaseActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
Integer venueId = spinnerValue;
|
||||
RadioButton radioButton = findCheckedRadioButton();
|
||||
|
||||
if (radioButton == null) {
|
||||
@@ -126,7 +122,7 @@ public class SDSettingActivity extends SDBaseActivity {
|
||||
String deviceTypeStr = (String) radioButton.getTag();
|
||||
String deviceType = deviceTypeStr;
|
||||
|
||||
SDAppConfig.getInstance().configSet(venueId, deviceType);
|
||||
SDAppConfig.getInstance().configSet(spinnerValue, deviceType);
|
||||
showToast("设置成功!");
|
||||
onGoToMainAction();
|
||||
} catch (Exception e) {
|
||||
@@ -164,15 +160,25 @@ public class SDSettingActivity extends SDBaseActivity {
|
||||
|
||||
}
|
||||
});
|
||||
// TODO: wyb, 2020-07-29, 这里可以设置为当前场馆的index.
|
||||
// int position = 0;
|
||||
// for (VenueItem venueItem : resultList){
|
||||
// if (spinnerValue.equals(venueItem.getVenueId())){
|
||||
// break;
|
||||
// }
|
||||
// position ++ ;
|
||||
// }
|
||||
// venueCellView.setSelection(position, false);
|
||||
Integer venueId = SDAppConfig.getInstance().getVenueId();
|
||||
String deviceType = SDAppConfig.getInstance().getDeviceType();
|
||||
if (venueId!=null){
|
||||
int position = 0;
|
||||
for (VenueItem venueItem : resultList){
|
||||
if (venueId.equals(venueItem.getVenueId())){
|
||||
break;
|
||||
}
|
||||
position ++ ;
|
||||
}
|
||||
venueCellView.setSelection(position, false);
|
||||
}
|
||||
if (deviceType!=null && !"".equals(deviceType)){
|
||||
if (deviceType.equals("OUT")){
|
||||
venueActionView.check(R.id.device_type_out);
|
||||
}else{
|
||||
venueActionView.check(R.id.device_type_enter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
android:layout_margin="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:spinnerMode="dropdown"
|
||||
tools:entries="@array/setting_spinner_test_list" />
|
||||
android:spinnerMode="dropdown"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -61,6 +60,7 @@
|
||||
|
||||
<RadioButton
|
||||
android:textColor="@color/black"
|
||||
android:id="@+id/device_type_enter"
|
||||
android:tag="ENTER"
|
||||
android:textStyle="bold"
|
||||
android:textSize="20sp"
|
||||
@@ -71,6 +71,7 @@
|
||||
|
||||
<RadioButton
|
||||
android:textColor="@color/black"
|
||||
android:id="@+id/device_type_out"
|
||||
android:tag="OUT"
|
||||
android:textStyle="bold"
|
||||
android:textSize="20sp"
|
||||
|
||||
Reference in New Issue
Block a user