Buggy code:
public class CancelAppointmentActivity extends BaseActivity { private LinearLayout llCancelAppointment ; private TextView tvHeading ; private TextView tvPatientName ; private TextView tvPatient ; private GridView gvAppointments ; private CancelAppointmentActivity . GridAdapter gridAdapter ; private Button btnCancelAppointment ; private PatientInfo patientInfo ; private AppointmentRow selectedPatientAppointment ; private int pageCount ; @ Override public void initializeControls ( ) { } @ Override public void bindControls ( ) { } private void callService ( ) { } private void getPatientAppointments ( int pageNumber ) { } private class GridAdapter extends BaseAdapter { private ArrayList < GetPatientAppointmentsResponse . AppointmentRow > patientAppointments ; @ Override public int getCount ( ) { } @ Override public Object getItem ( int arg0 ) { } @ Override public long getItemId ( int arg0 ) { } public void refresh ( ArrayList < GetPatientAppointmentsResponse . AppointmentRow > patientAppointments ) { } @ Override public View getView ( int pos , View view , ViewGroup parent ) { if ( view == null ) view = LayoutInflater . from ( CancelAppointmentActivity . this ) . inflate ( appointments_history_cell , null ) ; TextView tvDoctorName = ( ( TextView ) ( view . findViewById ( tvDoctorName ) ) ) ; TextView tvDateTime = ( ( TextView ) ( view . findViewById ( tvDateTime ) ) ) ; TextView tvTime = ( ( TextView ) ( view . findViewById ( tvTime ) ) ) ; final ImageView ivCheck = ( ( ImageView ) ( view . findViewById ( ivCheck ) ) ) ; tvDateTime . setTypeface ( WALSHEIM_LIGHT ) ; tvDoctorName . setTypeface ( WALSHEIM_LIGHT ) ; tvTime . setTypeface ( WALSHEIM_MEDIUM ) ; final GetPatientAppointmentsResponse . AppointmentRow data = patientAppointments . get ( pos ) ; long dayInstance = data . appointmentDetails . ConsultationDt . longValue ( ) ; long timeInstance = TimeUtils . getLongForHHMMSS ( ( ( data . appointmentDetails . StartTime ) + ":00" ) ) ; long totalInstance = dayInstance + timeInstance ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( ( DateUtils . isToday ( totalInstance ) ? "Today<seq2seq4repair_space>-<seq2seq4repair_space>" : ( TimeUtils . format2DateProper ( totalInstance ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) ) ; <START_BUG> tvDoctorName . setText ( data . doctorDetail . doctorFullName ) ; <END_BUG> tvDateTime . setText ( sb . toString ( ) ) ; tvTime . setText ( ( "<seq2seq4repair_space>" + ( getFormattedTime ( data . appointmentDetails . StartTime ) ) ) ) ; ivCheck . setTag ( ivCheck , pos ) ; if ( data . isSelected ) { ivCheck . setBackgroundResource ( check_box_sq_admin ) ; } else { ivCheck . setBackgroundResource ( un_check_admin ) ; } ivCheck . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { int pos = ( ( int ) ( ivCheck . getTag ( ivCheck ) ) ) ; Log . e ( "clicked<seq2seq4repair_space>at<seq2seq4repair_space>:<seq2seq4repair_space>" , ( "" + pos ) ) ; for ( GetPatientAppointmentsResponse . AppointmentRow data : patientAppointments ) data . isSelected = false ; if ( patientAppointments . get ( pos ) . isSelected ) { patientAppointments . get ( pos ) . isSelected = false ; } else { patientAppointments . get ( pos ) . isSelected = true ; } selectedPatientAppointment = data ; notifyDataSetChanged ( ) ; } } ) ; view . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { ivCheck . performClick ( ) ; } } ) ; return view ; } private String getFormattedTime ( String time ) { } } }

Fix:
tvDoctorName . setText ( ( "Dr." + ( data . doctorDetail . doctorFullName ) ) ) ;