i have some problem when trying to implement condition in "try" process, the result always of "globalnidn" always isi , therefore i've checked in logcat and the result is fine. :(
protected void onPostExecute(String data) {
try { JSONObject jObject = new JSONObject(data);
globalnidn = null;
globalnidn = jObject.getString("nidn");
String password = jObject.getString("password");
Toast.makeText(getBaseContext(),"nidn = "+globalnidn,Toast.LENGTH_SHORT).show();
if (globalnidn.equals(null)){
Toast.makeText(getBaseContext(),"kosong",Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getBaseContext(),"isi",Toast.LENGTH_SHORT).show();
}
}catch (Exception e) {
e.printStackTrace();
}
}
To test for null you should not use
globalnidn.equals(null)
but rather