请帮我解决Android中的Null Pointer Exception吗?

时间:2018-08-06 05:22:59

标签: android

public void onResponse(Call<User> call, Response<User> response) {
                            waitingDialog.dismiss();
                            User user = response.body();
                                if (TextUtils.isEmpty(user.getError_msg())) {
                                    Toast.makeText(MainActivity.this, "User has been registered successfully.", Toast.LENGTH_SHORT).show();
                                    //start new activity.
                                }
                        }

//和logcat是:java.lang.NullPointerException:尝试在空对象引用上调用虚拟方法'java.lang.String com.example.asus.drinksdeliverysystem.Model.User.getError_msg()'

0 个答案:

没有答案