Become a member
Sign in
Tutorial Android Insert data MySQL dengan Retrofit (CRUD Online Bagian 1)
657
57
Sulistiyanto
R Rifa Fauzi Komara
R Rifa Fauzi Komara
Jul 24, 2017 · 1 min read

FATAL EXCEPTION: main
Process: com.example.alvionnieta.mahasiswa, PID: 4056
java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String com.example.alvionnieta.mahasiswa.Value.getValue()’ on a null object reference
at com.example.alvionnieta.mahasiswa.MainActivity$1.onResponse(MainActivity.java:70)

terus yg error itu ada di →
@Override
public void onResponse(Call<Value> call, Response<Value> response) {
String value = response.body().getValue();
String message = response.body().getMessage();
progress.dismiss();
if (value.equals(“1”)) {
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
}
}

Kasih pencerahan mas mengenai errornya..

    R Rifa Fauzi Komara

    Written by

    R Rifa Fauzi Komara

    Write the first response

    Discover Medium

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

    Make Medium yours

    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

    Become a member

    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade
    AboutHelpLegal