File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
samples/android/marsSampleChat/app/src/main/java/com/tencent/mars/sample Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -216,21 +216,7 @@ public void onPreEncode(Main.ConversationListRequest req) {
216
216
217
217
@ Override
218
218
public void onPostDecode (Main .ConversationListResponse response ) {
219
- // update data list only
220
- if (response .list == null ) {
221
- Log .i (TAG , "getconvlist: empty response list" );
222
- progressBar .setVisibility (View .VISIBLE );
223
- return ;
224
- }
225
- else if (response .list .length == 0 ) {
226
- Log .i (TAG , "getconvlist: empty response list" );
227
- progressBar .setVisibility (View .VISIBLE );
228
- return ;
229
- }
230
219
231
- for (Main .Conversation conv : response .list ) {
232
- dataList .add (new Conversation (conv .name , conv .topic , conv .notice ));
233
- }
234
220
}
235
221
236
222
@ Override
@@ -239,6 +225,12 @@ public void onTaskEnd() {
239
225
240
226
@ Override
241
227
public void run () {
228
+ if (response != null ) {
229
+ for (Main .Conversation conv : response .list ) {
230
+ dataList .add (new Conversation (conv .name , conv .topic , conv .notice ));
231
+ }
232
+ }
233
+
242
234
if (!dataList .isEmpty ()) {
243
235
progressBar .setVisibility (View .INVISIBLE );
244
236
conversationListAdapter .list .clear ();
You can’t perform that action at this time.
0 commit comments