json をビューに一覧表示するアダプターを作成した json 応答があります。アプリにエラーはありませんが、結果も表示されません。これが私のアダプタークラスです:
package com.JustDine.Infrastructure;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.JustDine.GUI.R;
import com.JustDine.JSON.Response.RedemptionResult;
import com.JustDine.JSON.Response.SearchResult;
public class RedemptionListAdapter extends ArrayAdapter<RedemptionResult> {
Context context;
private List<RedemptionResult> redemptionResultList = new ArrayList<RedemptionResult>();
//public ArrayList<RedemptionResult> filtered = new ArrayList<RedemptionResult>();
// public boolean isFiltered;
int position;
int textViewResourceId;
ImageLoader imageLoader;
public RedemptionListAdapter(Context context, int textViewResourceId,
List<RedemptionResult> redemptionResultList) {
super(context, textViewResourceId, redemptionResultList);
this.context = context;
this.redemptionResultList = redemptionResultList;
this.textViewResourceId = textViewResourceId;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
this.position = position;
LinearLayout redemptionView;
RedemptionResult redemptionResult = null;
redemptionResult = redemptionResultList.get(position);
if (v == null) {
redemptionView = new LinearLayout(getContext());
LayoutInflater vi = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(textViewResourceId, redemptionView, true);
}
TextView tvName = (TextView) v.findViewById(R.id.resName);
tvName.setText(redemptionResult.getName());
return v;
}
}
結果が表示されない理由を教えてください。
更新: JSON 応答クラス
package com.JustDine.JSON.Response;
import java.util.List;
import com.google.gson.annotations.SerializedName;
public class RedemptionResultResponse {
@SerializedName("Success")
public boolean Success;
@SerializedName("redemption_partners")
private List<RedemptionResult> getRedemptionPartners;
@SerializedName("denominations")
private List<DenominationsResult> getDenominations;
@SerializedName("errorMessage")
public String errorMessage;
@SerializedName("Tag")
public String Tag;
public List<RedemptionResult> getRedemptionPartners() {
return getRedemptionPartners;
}
public List<DenominationsResult> getDenominations() {
return getDenominations;
}
public void setRedemptionPartners(List<RedemptionResult> getRedemptionPartners) {
this.getRedemptionPartners = getRedemptionPartners;
}
public void setDenominationss(List<DenominationsResult> getDenominations) {
this.getDenominations = getDenominations;
}
}
と
package com.JustDine.JSON.Response;
import com.google.gson.annotations.SerializedName;
public class RedemptionResult {
@SerializedName("id")
private String id;
@SerializedName("name")
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}