这里包含的TextView JSON数据varible是我的代码:我如何通过使用改装
public void jsontesting(){
//While the app fetched data we are displaying a progress dialog
//Creating a rest adapter
RestAdapter restAdapter = (RestAdapter) new RestAdapter.Builder().setEndpoint(getResources().getString(R.string.master_url)).build();
//Creating an object of our api interface
LatlngAPI api = restAdapter.create(LatlngAPI.class);
//Defining the method
api.get_doctor("10",new retrofit.Callback<LatlngOperations>(){
@Override
public void success(LatlngOperations res, Response response) {
for(Doctor d:res){
Log.d("id", d.getClinic_id());
//}
/*if (!res.isError()) {*/
String id=d.getId().toString();
Log.d("id", d.getId());
String clinic_id=d.getClinic_id().toString();
String clinic_name=d.getClinic_name().toString();
String Name=d.getName().toString();
String Degree=d.getDegree().toString();
String Degree_name=d.getDegree_name().toString();
String Experience=d.getExperience().toString();
String Consultation=d.getConsultation().toString();
String Insurances_accepted=d.getInsurances_accepted().toString();
String Image=d.getImage().toString();
String Clinic_image=d.getClinic_image().toString();
String Address=d.getAddress().toString();
String Address2=d.getAddress2().toString();
String Location=d.getLocation().toString();
} else {
Toast.makeText(
MainActivity.this,"No Record found",
Toast.LENGTH_SHORT).show();
}
}
@Override
public void failure(RetrofitError error) {
// dismiss_dialog();
Log.d("Error", error.toString());
/*Toast.makeText(LoginActivity.this, R.string.retrofit_error,
Toast.LENGTH_SHORT).show();*/
}
});
}
并不清楚你的要求。 – Rohit5k2