at my database table, there's a column name "time_photo_before". The column automatically set to NULL if there's no data.
At android, I got a problem. Although I set the text to "No time" when the data is null, but it still appears the next "null" at the TextView. But if there's a data, the data will display. Below is my code:
timePhotoBefore = findViewById(R.id.timePhotoBefore);
if(taskClass.getTime_photo_before() != null ){
timePhotoBefore.setText(taskClass.getTime_photo_before());
}else {
timePhotoBefore.setText("No time");
}
Can I know what is the problem?
I think you should write like this!