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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 663 by torben, Fri Apr 23 15:23:44 2010 UTC revision 950 by torben, Mon Jul 5 08:18:02 2010 UTC
# Line 8  import com.gc.android.market.api.model.M Line 8  import com.gc.android.market.api.model.M
8  import com.gc.android.market.api.model.Market.ResponseContext;  import com.gc.android.market.api.model.Market.ResponseContext;
9    
10  public class CommentCallback implements Callback<CommentsResponse>{  public class CommentCallback implements Callback<CommentsResponse>{
         private String locale;  
11          private List<CommentBean> commentBeans;          private List<CommentBean> commentBeans;
12                    
13          private int entryCount;          private int entryCount;
14                    
         public void setLocale(String loc) {  
                 locale = loc;  
         }  
           
15          public void setList(List<CommentBean> cl) {          public void setList(List<CommentBean> cl) {
16                  commentBeans = cl;                  commentBeans = cl;
17          }          }
# Line 29  public class CommentCallback implements Line 24  public class CommentCallback implements
24          @Override          @Override
25          public void onResult(ResponseContext context, CommentsResponse response) {          public void onResult(ResponseContext context, CommentsResponse response) {
26                  //System.out.println("Response : " + response);                  //System.out.println("Response : " + response);
                 //sb.append("Response: " + response + "\n");  
27                  entryCount = response.getEntriesCount();                  entryCount = response.getEntriesCount();
28                  System.out.println("Count="+entryCount);                  
29                    //System.out.println("Count="+entryCount);
30    
31                  List<Comment> cl = response.getCommentsList();                  List<Comment> cl = response.getCommentsList();
32                  for (Comment c : cl) {                  for (Comment c : cl) {
33                          CommentBean bean = new CommentBean();                          CommentBean bean = new CommentBean();
                         bean.locale = locale;  
34                          bean.author = c.getAuthorName();                          bean.author = c.getAuthorName();
35                          bean.rating = c.getRating();                          bean.rating = c.getRating();
36                          bean.time = c.getCreationTime();                          bean.time = c.getCreationTime();
37                          bean.text = c.getText();                          bean.text = c.getText();
38                          commentBeans.add(bean);                          commentBeans.add(bean);
39                  }                  }
40                    
41          }          }
42  }  }

Legend:
Removed from v.663  
changed lines
  Added in v.950

  ViewVC Help
Powered by ViewVC 1.1.20