I have two classes in Parse.com
1- called HospitalAppointment which have list of appointments and each object has (AppointmentDate (date) , DoctorFile (pointer (to class Doctors) ) and other ... )
2- class called Doctor ( has doctor name ( string) , ID .. other info )
and I have 2 java classes in android studio
1- my main activity in this class I do query for class HospitalAppointment
ParseQuery<ParseObject> doctors = ParseQuery.getQuery("HospitalAppointment");
doctors.whereEqualTo("AppointmentDate",startDate);
doctors.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> status, com.parse.ParseException e) {
if (status == null) {
Log.d("score", "no doctor available: ");
} else {
mStatus = status;
DoctorAdapter adapter = new DoctorAdapter(getListView().getContext(), mStatus);
setListAdapter(adapter);
}
}
});
and in the DoctorAdapter activity where I write the function for the listview is the problem
public class DoctorAdapter extends ArrayAdapter<ParseObject> {
protected Context mContext;
protected List<ParseObject> mStatus;
public DoctorAdapter(Context context, List<ParseObject> status) {
super(context, R.layout.doctor_listadapter, status);
mContext = context;
mStatus = status;
}
//getview used to inflate each row
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(
R.layout.doctor_listadapter, null);
holder = new ViewHolder();//create new view
holder.mDocName = (TextView) convertView.findViewById(R.id.doctorName);//very imp to convertview
holder.mDocId = (TextView) convertView.findViewById(R.id.doctorId);
convertView.setTag(holder);//holder as parameter
} else {
holder = (ViewHolder) convertView.getTag();
}
ParseObject statusObject = mStatus.get(position);//postition of that row
ParseObject getDoctorID = statusObject.getParseObject("DoctorName");
String docId= getDoctorID.getObjectId();
holder.mDocId.setText(docId);
*// here is the problem I cannot retrive the Pointer data like Doctor name*
return convertView;
}
public static class ViewHolder {
TextView mDocId;
TextView mDocName;
}}
I retrieve the object Id but the problem in the pointer I can't get any data from the pointer I try the query method I call the class name "Doctors" and I do find the "ID of the doctor to get his name but it doesn't work
and I try doing Parse object and I get this object but also not work ?
I hope you can help me