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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 662 - (show annotations) (download)
Fri Apr 23 14:13:39 2010 UTC (14 years ago) by torben
File size: 1060 byte(s)
merge danish and english comments
1 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 public void setLocale(String loc) {
15 locale = loc;
16 }
17
18 public void setList(List<CommentBean> cl) {
19 commentBeans = cl;
20 }
21
22
23
24
25 @Override
26 public void onResult(ResponseContext context, CommentsResponse response) {
27 //System.out.println("Response : " + response);
28 //sb.append("Response: " + response + "\n");
29
30 List<Comment> cl = response.getCommentsList();
31 for (Comment c : cl) {
32 CommentBean bean = new CommentBean();
33 bean.locale = locale;
34 bean.author = c.getAuthorName();
35 bean.rating = c.getRating();
36 bean.time = c.getCreationTime();
37 bean.text = c.getText();
38 commentBeans.add(bean);
39 }
40 }
41 }

  ViewVC Help
Powered by ViewVC 1.1.20