|
|
|
@ -58,8 +58,8 @@ public class WriteUserActivity extends BaseActivity implements DataReturnCall, P
|
|
|
|
|
popupMenu = new PopupMenu(this, binding.writeMenu);
|
|
|
|
|
popupMenu.setOnMenuItemClickListener(this);
|
|
|
|
|
getMenuInflater().inflate(R.menu.activity_menu, popupMenu.getMenu());
|
|
|
|
|
rfidModel = new C5106Device(this,this);
|
|
|
|
|
// rfidModel=new AutoID9UDevice(this,this);
|
|
|
|
|
// rfidModel = new C5106Device(this,this);
|
|
|
|
|
rfidModel=new AutoID9UDevice(this,this);
|
|
|
|
|
if (rfidModel instanceof C5106Device){
|
|
|
|
|
intent1 = new Intent(this, ReadActivity.class);
|
|
|
|
|
}else {
|
|
|
|
@ -124,25 +124,30 @@ public class WriteUserActivity extends BaseActivity implements DataReturnCall, P
|
|
|
|
|
if (body.getSaveFlag().equals("1")) {
|
|
|
|
|
Toast.makeText(WriteUserActivity.this, getString(R.string.binding_success), Toast.LENGTH_SHORT).show();
|
|
|
|
|
writeUserState = true;
|
|
|
|
|
writeUser(user,epcStr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
tipDialog.shouDialog(false, body.getSaveMessage());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
writeUser(user,epcStr);
|
|
|
|
|
}
|
|
|
|
|
//writeUserState = true;
|
|
|
|
|
if (writeUserState){
|
|
|
|
|
Log.e("TAG", "写入");
|
|
|
|
|
var writeState = rfidModel.writeUser(validateDataLength(user), epcStr);
|
|
|
|
|
tipDialog.shouDialog(writeState,getString(writeState ? R.string.write_success : R.string.write_failed));
|
|
|
|
|
if (writeState) {
|
|
|
|
|
list.clear();
|
|
|
|
|
adapter.notifyDataSetChanged();
|
|
|
|
|
binding.writeEpcCode.setText(null);
|
|
|
|
|
binding.writeTire.setText(null);
|
|
|
|
|
writeUserState=false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void writeUser(String user ,String epcStr){
|
|
|
|
|
Log.e("TAG", "写入");
|
|
|
|
|
var writeState = rfidModel.writeUser(validateDataLength(user), epcStr);
|
|
|
|
|
tipDialog.shouDialog(writeState,getString(writeState ? R.string.write_success : R.string.write_failed));
|
|
|
|
|
if (writeState) {
|
|
|
|
|
list.clear();
|
|
|
|
|
adapter.notifyDataSetChanged();
|
|
|
|
|
binding.writeEpcCode.setText(null);
|
|
|
|
|
binding.writeTire.setText(null);
|
|
|
|
|
writeUserState=false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|