@FormUrlEncoded
@POST("/api/user_register")
void registerApi(@Field("first_name") String first_name,
                 @Field("last_name") String last_name,
                 @Field("email") String email,
                 @Field("password") String password,
                 @Field("reg_id") String reg_id,
                 @Field("device_type") String device_type,
                 @Field("login_type") String login_type,
                 Callback<RegisterMyPojo> registerMyPojoCallback);

public class ApiServiceClass {

    public static <S> S createService(Class<S> service_class) {
        RestAdapter.Builder restBuilder = new RestAdapter.Builder().setEndpoint(BaseUrl.BASE_URL);
        RestAdapter restAdapter = restBuilder.build();
        return restAdapter.create(service_class);
    }
}

private void organizationApi() {
Helper.showLoader(this, “Please Wait”);
ApiClass apiClass = ApiServiceClass.CreateService(ApiClass.class);
apiClass.getOrganization(new Callback<MainJsonClass>() {
@Override
public void success(MainJsonClass mainJsonClass, retrofit.client.Response response) {
Helper.hideLoader();
spinner.setVisibility(View.VISIBLE);
if (mainJsonClass.getSuccess().equals(“1”)) {
arrayList = new ArrayList<String>();
List<Organization_list> organization_list = mainJsonClass.getOrganization_list();
for (int i = 0; i < organization_list.size(); i++) {
arrayList.add(organization_list.get(i).getName());
}
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(DonateActivity.this, R.layout.item_organization, R.id.txt_india1, arrayList); //selected item will look like a spinner set from XML
spinnerArrayAdapter.setDropDownViewResource(R.layout.item_organization);
spinner.setAdapter(spinnerArrayAdapter);
String spinner1 = spinner.getSelectedItem().toString();
Log.e(“Spinner”, spinner1);
Helper.setOrganization(spinner1, sActivity);
} else {
Toast.makeText(sActivity, “” + mainJsonClass.getMessage(), Toast.LENGTH_SHORT).show();
}
}

@Override
public void failure(RetrofitError error) {
Helper.hideLoader();
Log.e(“error:-“, “” + error);
}
});
}