I'm having this code. my input data (Call process) successfully inserted to the database, but I didn't get the return data using call.enqueue. it gives me the "failed" toast instead the "success" one. I'm using retrofit 2.1.0. and here is my imports:
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
and this is my code
public void performRegistration(){
final String name = uname.getText().toString();
final String email = mail.getText().toString();
final String pw1 = password1.getText().toString();
final String pw2 = password2.getText().toString();
Call<User> call = MainActivity.apiInterface.performRegistration(name, email, pw1);
call.enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
MainActivity.prefConfig.displayToast("success");
}
@Override
public void onFailure(Call<User> call, Throwable t) {
MainActivity.prefConfig.displayToast("Failed");
}
});
}