SHARE
TWEET

methode delete

a guest Jan 24th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Call<ResponseLogin> delete =service.delete(34);
  2.  
  3.         delete.enqueue(new Callback<ResponseLogin>() {
  4.             @Override
  5.             public void onResponse(Call<ResponseLogin> call, Response<ResponseLogin> response) {
  6.                 if(response.isSuccessful()){
  7.                     Toast.makeText(MainActivity.this, "Data Anda berhasil di hapus", Toast.LENGTH_SHORT).show();
  8.  
  9.                 }else if(response.code() == 400){
  10.                     Toast.makeText(MainActivity.this, "Data tidak boleh kosong"+response.code(), Toast.LENGTH_SHORT).show();
  11.  
  12.                 }else if(response.code() == 204){
  13.                     Toast.makeText(MainActivity.this, "Data yang anda hapus tidak ditemukan", Toast.LENGTH_SHORT).show();
  14.                 }
  15.             }
  16.  
  17.             @Override
  18.             public void onFailure(Call<ResponseLogin> call, Throwable t) {
  19.  
  20.             }
  21.         });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top