|
|
@ -9,7 +9,6 @@ import android.os.Looper;
|
|
|
|
import android.os.Message;
|
|
|
|
import android.os.Message;
|
|
|
|
import android.text.Editable;
|
|
|
|
import android.text.Editable;
|
|
|
|
import android.text.TextWatcher;
|
|
|
|
import android.text.TextWatcher;
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.Toast;
|
|
|
|
import android.widget.Toast;
|
|
|
@ -81,7 +80,9 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
if(tiNewMsg.getText() != null){
|
|
|
|
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case ModelFieldConstants.COLLEGE_NAME : {
|
|
|
|
case ModelFieldConstants.COLLEGE_NAME : {
|
|
|
@ -92,7 +93,9 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
if(tiNewMsg.getText() != null){
|
|
|
|
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case ModelFieldConstants.REAL_NAME : {
|
|
|
|
case ModelFieldConstants.REAL_NAME : {
|
|
|
@ -103,7 +106,9 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
if(tiNewMsg.getText() != null){
|
|
|
|
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case ModelFieldConstants.ID_NUMBER : {
|
|
|
|
case ModelFieldConstants.ID_NUMBER : {
|
|
|
@ -118,7 +123,9 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
if(tiNewMsg.getText() != null){
|
|
|
|
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case ModelFieldConstants.GENDER : {
|
|
|
|
case ModelFieldConstants.GENDER : {
|
|
|
@ -138,36 +145,24 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
tiNewMsg.setKeyListener(null);
|
|
|
|
tiNewMsg.setKeyListener(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tiNewMsg.setOnClickListener(new View.OnClickListener() {
|
|
|
|
tiNewMsg.setOnClickListener(v -> {
|
|
|
|
@Override
|
|
|
|
System.out.println("choose gender............");
|
|
|
|
public void onClick(View v) {
|
|
|
|
String[] singleItems = {"男", "女"};
|
|
|
|
System.out.println("choose gender............");
|
|
|
|
int checkedItem = 0;
|
|
|
|
String[] singleItems = {"男", "女"};
|
|
|
|
if(tiNewMsg.getText() != null){
|
|
|
|
int checkedItem = "男".equals(tiNewMsg.getText().toString()) ? 0 : 1;
|
|
|
|
checkedItem = "男".equals(tiNewMsg.getText().toString()) ? 0 : 1;
|
|
|
|
|
|
|
|
|
|
|
|
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(ModifyUserInfo.this)
|
|
|
|
|
|
|
|
.setTitle("请选择性别")
|
|
|
|
|
|
|
|
.setNeutralButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
|
|
|
tiNewMsg.setText(singleItems[bundle.getInt("checkedItem")]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.setSingleChoiceItems(singleItems, checkedItem, new DialogInterface.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
|
|
|
bundle.putInt("checkedItem", which);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
materialAlertDialogBuilder.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(ModifyUserInfo.this)
|
|
|
|
|
|
|
|
.setTitle("请选择性别")
|
|
|
|
|
|
|
|
.setNeutralButton(getString(R.string.cancel), (dialog, which) -> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.setPositiveButton(getString(R.string.ok), (dialog, which) ->
|
|
|
|
|
|
|
|
tiNewMsg.setText(singleItems[bundle.getInt("checkedItem")]))
|
|
|
|
|
|
|
|
.setSingleChoiceItems(singleItems, checkedItem, (dialog, which) ->
|
|
|
|
|
|
|
|
bundle.putInt("checkedItem", which));
|
|
|
|
|
|
|
|
materialAlertDialogBuilder.show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -179,7 +174,9 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
if (tiNewMsg.getText() != null){
|
|
|
|
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case ModelFieldConstants.PHONE : {
|
|
|
|
case ModelFieldConstants.PHONE : {
|
|
|
@ -190,11 +187,14 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
tiNewMsg.setText("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
if(tiNewMsg.getText() != null){
|
|
|
|
|
|
|
|
tiNewMsg.setSelection(tiNewMsg.getText().length());
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:{
|
|
|
|
default:{
|
|
|
|
tiNewMsg.setText("error.....");
|
|
|
|
String errorText = "error.....";
|
|
|
|
|
|
|
|
tiNewMsg.setText(errorText);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -204,12 +204,7 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void setListener(){
|
|
|
|
private void setListener(){
|
|
|
|
//返回上一个活动,也就是个人信息部分
|
|
|
|
//返回上一个活动,也就是个人信息部分
|
|
|
|
abIvTitle.setOnClickListener(new View.OnClickListener() {
|
|
|
|
abIvTitle.setOnClickListener(v -> finish());
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
finish();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
tiNewMsg.addTextChangedListener(new TextWatcher() {
|
|
|
|
tiNewMsg.addTextChangedListener(new TextWatcher() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
@ -224,12 +219,7 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
abBtSave.setBackgroundResource(R.drawable.selector_bottom_modify_info_save_2);
|
|
|
|
abBtSave.setBackgroundResource(R.drawable.selector_bottom_modify_info_save_2);
|
|
|
|
abBtSave.setTextColor(Color.WHITE);
|
|
|
|
abBtSave.setTextColor(Color.WHITE);
|
|
|
|
//为按钮添加点击事件
|
|
|
|
//为按钮添加点击事件
|
|
|
|
abBtSave.setOnClickListener(new View.OnClickListener() {
|
|
|
|
abBtSave.setOnClickListener(v -> dialog());
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
dialog();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -244,6 +234,7 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void dialog(){
|
|
|
|
private void dialog(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加取消
|
|
|
|
AlertDialog alertDialog2 = new AlertDialog.Builder(this)
|
|
|
|
AlertDialog alertDialog2 = new AlertDialog.Builder(this)
|
|
|
|
.setMessage("请确认是否进行" + abTvTitle.getText())
|
|
|
|
.setMessage("请确认是否进行" + abTvTitle.getText())
|
|
|
|
.setPositiveButton("确定", new DialogInterface.OnClickListener() {//添加"Yes"按钮
|
|
|
|
.setPositiveButton("确定", new DialogInterface.OnClickListener() {//添加"Yes"按钮
|
|
|
@ -259,10 +250,7 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.setNegativeButton("取消", new DialogInterface.OnClickListener() {//添加取消
|
|
|
|
.setNegativeButton("取消", (dialogInterface, i) -> {
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.create();
|
|
|
|
.create();
|
|
|
|
alertDialog2.show();
|
|
|
|
alertDialog2.show();
|
|
|
@ -272,57 +260,23 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
* 更新信息网络请求
|
|
|
|
* 更新信息网络请求
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void modifyInfo(){
|
|
|
|
private void modifyInfo(){
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
new Thread(() -> {
|
|
|
|
@Override
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
public void run() {
|
|
|
|
boolean isLegalInput = false;
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
try {
|
|
|
|
boolean isLegalInput = false;
|
|
|
|
jsonObject.put(ModelFieldConstants.ID, (Long) bundle.get(ModelFieldConstants.ID));
|
|
|
|
try {
|
|
|
|
} catch (JSONException e) {
|
|
|
|
jsonObject.put(ModelFieldConstants.ID, (Long) bundle.get(ModelFieldConstants.ID));
|
|
|
|
e.printStackTrace();
|
|
|
|
} catch (JSONException e) {
|
|
|
|
}
|
|
|
|
e.printStackTrace();
|
|
|
|
//根据上一个活动传递过来的选择字段,来选择对应的传输方法
|
|
|
|
}
|
|
|
|
String modifyField = (String) bundle.get(ModelFieldConstants.TO_BE_MODIFY);
|
|
|
|
//根据上一个活动传递过来的选择字段,来选择对应的传输方法
|
|
|
|
switch (modifyField){
|
|
|
|
String modifyField = (String) bundle.get(ModelFieldConstants.TO_BE_MODIFY);
|
|
|
|
case ModelFieldConstants.ID_NUMBER:
|
|
|
|
switch (modifyField){
|
|
|
|
case ModelFieldConstants.IN_SCHOOL_TIME:{
|
|
|
|
case ModelFieldConstants.ID_NUMBER:
|
|
|
|
|
|
|
|
case ModelFieldConstants.IN_SCHOOL_TIME:{
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Long msg = Long.parseLong(Objects.requireNonNull(tiNewMsg.getText()).toString());
|
|
|
|
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
|
|
|
|
bundle.putLong(modifyField, msg);
|
|
|
|
|
|
|
|
isLegalInput = true;
|
|
|
|
|
|
|
|
}catch (NumberFormatException e){
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
Message msg = new Message();
|
|
|
|
|
|
|
|
msg.obj = "输入非法.";
|
|
|
|
|
|
|
|
handler.sendMessage(msg);
|
|
|
|
|
|
|
|
}catch (JSONException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case ModelFieldConstants.GENDER:{
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
|
|
|
|
if("男".equals(msg) || "女".equals(msg)){
|
|
|
|
|
|
|
|
Boolean msgBoolean = "男".equals(msg);
|
|
|
|
|
|
|
|
jsonObject.put(modifyField, msgBoolean);
|
|
|
|
|
|
|
|
bundle.putBoolean(modifyField, msgBoolean);
|
|
|
|
|
|
|
|
isLegalInput = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (JSONException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case ModelFieldConstants.PHONE: {
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
Long msg = Long.parseLong(Objects.requireNonNull(tiNewMsg.getText()).toString());
|
|
|
|
//判断输入电话号码是否能解析为long型,能解析的话说明输入没有非法字符
|
|
|
|
|
|
|
|
Long msgLong = Long.parseLong(msg);
|
|
|
|
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
bundle.putString(modifyField, msg);
|
|
|
|
bundle.putLong(modifyField, msg);
|
|
|
|
isLegalInput = true;
|
|
|
|
isLegalInput = true;
|
|
|
|
}catch (NumberFormatException e){
|
|
|
|
}catch (NumberFormatException e){
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
@ -330,72 +284,103 @@ public class ModifyUserInfo extends AppCompatActivity {
|
|
|
|
msg.obj = "输入非法.";
|
|
|
|
msg.obj = "输入非法.";
|
|
|
|
handler.sendMessage(msg);
|
|
|
|
handler.sendMessage(msg);
|
|
|
|
}catch (JSONException e) {
|
|
|
|
}catch (JSONException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case ModelFieldConstants.GENDER:{
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
|
|
|
|
if("男".equals(msg) || "女".equals(msg)){
|
|
|
|
|
|
|
|
Boolean msgBoolean = "男".equals(msg);
|
|
|
|
|
|
|
|
jsonObject.put(modifyField, msgBoolean);
|
|
|
|
|
|
|
|
bundle.putBoolean(modifyField, msgBoolean);
|
|
|
|
|
|
|
|
isLegalInput = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
} catch (JSONException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case ModelFieldConstants.EMAIL:{
|
|
|
|
break;
|
|
|
|
Message message = new Message();
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
case ModelFieldConstants.PHONE: {
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
try {
|
|
|
|
String[] msgStr = msg.split("@");
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
//必须得包含@符号
|
|
|
|
//判断输入电话号码是否能解析为long型,能解析的话说明输入没有非法字符
|
|
|
|
if(msgStr.length == 2){
|
|
|
|
// Long msgLong = Long.parseLong(msg);
|
|
|
|
//邮箱的两部分必定是长度大于0的
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
if(msgStr[0].length() > 0 && msgStr[1].length() > 0){
|
|
|
|
bundle.putString(modifyField, msg);
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
isLegalInput = true;
|
|
|
|
bundle.putString(modifyField, msg);
|
|
|
|
}catch (NumberFormatException e){
|
|
|
|
isLegalInput = true;
|
|
|
|
e.printStackTrace();
|
|
|
|
}else{
|
|
|
|
Message msg = new Message();
|
|
|
|
message.obj = "输入非法.";
|
|
|
|
msg.obj = "输入非法.";
|
|
|
|
handler.sendMessage(message);
|
|
|
|
handler.sendMessage(msg);
|
|
|
|
}
|
|
|
|
}catch (JSONException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case ModelFieldConstants.EMAIL:{
|
|
|
|
|
|
|
|
Message message = new Message();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
|
|
|
|
String[] msgStr = msg.split("@");
|
|
|
|
|
|
|
|
//必须得包含@符号
|
|
|
|
|
|
|
|
if(msgStr.length == 2){
|
|
|
|
|
|
|
|
//邮箱的两部分必定是长度大于0的
|
|
|
|
|
|
|
|
if(msgStr[0].length() > 0 && msgStr[1].length() > 0){
|
|
|
|
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
|
|
|
|
bundle.putString(modifyField, msg);
|
|
|
|
|
|
|
|
isLegalInput = true;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
message.obj = "输入非法.";
|
|
|
|
message.obj = "输入非法.";
|
|
|
|
handler.sendMessage(message);
|
|
|
|
handler.sendMessage(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (NumberFormatException e){
|
|
|
|
}else{
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
message.obj = "输入非法.";
|
|
|
|
message.obj = "输入非法.";
|
|
|
|
handler.sendMessage(message);
|
|
|
|
handler.sendMessage(message);
|
|
|
|
}catch (JSONException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (NumberFormatException e){
|
|
|
|
break;
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
message.obj = "输入非法.";
|
|
|
|
|
|
|
|
handler.sendMessage(message);
|
|
|
|
|
|
|
|
}catch (JSONException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:{
|
|
|
|
|
|
|
|
try {
|
|
|
|
break;
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
}
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
default:{
|
|
|
|
bundle.putString(modifyField, msg);
|
|
|
|
try {
|
|
|
|
isLegalInput = true;
|
|
|
|
String msg = Objects.requireNonNull(tiNewMsg.getText()).toString();
|
|
|
|
} catch (JSONException e) {
|
|
|
|
jsonObject.put(modifyField, msg);
|
|
|
|
e.printStackTrace();
|
|
|
|
bundle.putString(modifyField, msg);
|
|
|
|
}
|
|
|
|
isLegalInput = true;
|
|
|
|
|
|
|
|
} catch (JSONException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
System.out.println( "jsonObject : " + jsonObject.toString() + "..............................");
|
|
|
|
}
|
|
|
|
String json = jsonObject.toString();
|
|
|
|
System.out.println( "jsonObject : " + jsonObject + "..............................");
|
|
|
|
String url = UrlConstants.USER_UPDATE;
|
|
|
|
String json = jsonObject.toString();
|
|
|
|
|
|
|
|
String url = UrlConstants.USER_UPDATE;
|
|
|
|
|
|
|
|
|
|
|
|
if(isLegalInput){
|
|
|
|
if(isLegalInput){
|
|
|
|
new PostBodyParamHttpUtils() {
|
|
|
|
new PostBodyParamHttpUtils() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void nextMethod(BaseResponse<Object> baseResponse) {
|
|
|
|
public void nextMethod(BaseResponse<Object> baseResponse) {
|
|
|
|
Intent intent = new Intent();
|
|
|
|
Intent intent = new Intent();
|
|
|
|
intent.putExtras(bundle);
|
|
|
|
intent.putExtras(bundle);
|
|
|
|
setResult(RESULT_OK,intent);
|
|
|
|
setResult(RESULT_OK,intent);
|
|
|
|
finish();
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void failedMethod(BaseResponse<Object> baseResponse) {
|
|
|
|
public void failedMethod(BaseResponse<Object> baseResponse) {
|
|
|
|
Message message = new Message();
|
|
|
|
Message message = new Message();
|
|
|
|
System.out.println("修改失败.......................");
|
|
|
|
System.out.println("修改失败.......................");
|
|
|
|
handler.sendMessage(message);
|
|
|
|
handler.sendMessage(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.postConnect(url, json);
|
|
|
|
}.postConnect(url, json);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).start();
|
|
|
|
}).start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|