package dk.thoerup.marketstats; import java.util.List; import com.gc.android.market.api.MarketSession.Callback; import com.gc.android.market.api.model.Market.Comment; import com.gc.android.market.api.model.Market.CommentsResponse; import com.gc.android.market.api.model.Market.ResponseContext; public class CommentCallback implements Callback{ private String locale; private List commentBeans; private int entryCount; public void setLocale(String loc) { locale = loc; } public void setList(List cl) { commentBeans = cl; } public int getEntryCount() { return entryCount; } @Override public void onResult(ResponseContext context, CommentsResponse response) { //System.out.println("Response : " + response); //sb.append("Response: " + response + "\n"); entryCount = response.getEntriesCount(); //System.out.println("Count="+entryCount); List cl = response.getCommentsList(); for (Comment c : cl) { CommentBean bean = new CommentBean(); bean.locale = locale; bean.author = c.getAuthorName(); bean.rating = c.getRating(); bean.time = c.getCreationTime(); bean.text = c.getText(); commentBeans.add(bean); } } }