/[projects]/android/MarketStats/src/dk/thoerup/marketstats/CommentCallback.java
ViewVC logotype

Annotation of /android/MarketStats/src/dk/thoerup/marketstats/CommentCallback.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 663 - (hide annotations) (download)
Fri Apr 23 15:23:44 2010 UTC (14 years, 1 month ago) by torben
File size: 1225 byte(s)
Load more comments
1 torben 662 package dk.thoerup.marketstats;
2    
3     import java.util.List;
4    
5     import com.gc.android.market.api.MarketSession.Callback;
6     import com.gc.android.market.api.model.Market.Comment;
7     import com.gc.android.market.api.model.Market.CommentsResponse;
8     import com.gc.android.market.api.model.Market.ResponseContext;
9    
10     public class CommentCallback implements Callback<CommentsResponse>{
11     private String locale;
12     private List<CommentBean> commentBeans;
13    
14 torben 663 private int entryCount;
15    
16 torben 662 public void setLocale(String loc) {
17     locale = loc;
18     }
19    
20     public void setList(List<CommentBean> cl) {
21     commentBeans = cl;
22     }
23    
24 torben 663 public int getEntryCount() {
25     return entryCount;
26     }
27 torben 662
28    
29     @Override
30     public void onResult(ResponseContext context, CommentsResponse response) {
31     //System.out.println("Response : " + response);
32     //sb.append("Response: " + response + "\n");
33 torben 663 entryCount = response.getEntriesCount();
34     System.out.println("Count="+entryCount);
35 torben 662
36     List<Comment> cl = response.getCommentsList();
37     for (Comment c : cl) {
38     CommentBean bean = new CommentBean();
39     bean.locale = locale;
40     bean.author = c.getAuthorName();
41     bean.rating = c.getRating();
42     bean.time = c.getCreationTime();
43     bean.text = c.getText();
44     commentBeans.add(bean);
45     }
46     }
47     }

  ViewVC Help
Powered by ViewVC 1.1.20