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 List<CommentBean> commentBeans; |
12 |
|
|
|
13 |
torben |
663 |
private int entryCount; |
14 |
|
|
|
15 |
torben |
662 |
public void setList(List<CommentBean> cl) { |
16 |
|
|
commentBeans = cl; |
17 |
|
|
} |
18 |
|
|
|
19 |
torben |
663 |
public int getEntryCount() { |
20 |
|
|
return entryCount; |
21 |
|
|
} |
22 |
torben |
662 |
|
23 |
|
|
|
24 |
|
|
@Override |
25 |
|
|
public void onResult(ResponseContext context, CommentsResponse response) { |
26 |
|
|
//System.out.println("Response : " + response); |
27 |
|
|
//sb.append("Response: " + response + "\n"); |
28 |
torben |
663 |
entryCount = response.getEntriesCount(); |
29 |
torben |
664 |
|
30 |
|
|
//System.out.println("Count="+entryCount); |
31 |
torben |
662 |
|
32 |
|
|
List<Comment> cl = response.getCommentsList(); |
33 |
|
|
for (Comment c : cl) { |
34 |
|
|
CommentBean bean = new CommentBean(); |
35 |
|
|
bean.author = c.getAuthorName(); |
36 |
|
|
bean.rating = c.getRating(); |
37 |
|
|
bean.time = c.getCreationTime(); |
38 |
|
|
bean.text = c.getText(); |
39 |
|
|
commentBeans.add(bean); |
40 |
|
|
} |
41 |
torben |
756 |
|
42 |
torben |
662 |
} |
43 |
|
|
} |