コード例 #1
0
 @Override
 protected void onPostExecute(String result) {
   super.onPostExecute(result);
   if ("failed".equals(result)) {
     ShowToast.toast(CreateGroupActivity.this, "服务器异常,请稍后再试");
   } else {
     final String[] arr = result.split(",");
     ShowToast.toast(CreateGroupActivity.this, "创建成功,快去叫你的小伙伴加群哦");
     RongIM.setGroupInfoProvider(
         new GroupInfoProvider() {
           @Override
           public Group getGroupInfo(String arg0) {
             Group group =
                 new Group(arr[1], et_group_name.getText().toString(), Uri.parse(imgs[4]));
             return group;
           }
         },
         true);
     //				finish();
     startActivity(new Intent(CreateGroupActivity.this, MainActivity.class));
     finish();
   }
 }
コード例 #2
0
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.back:
       finish();
       break;
     case R.id.create_group:
       // 创建群
       create_group.setVisibility(View.INVISIBLE);
       if (NetConn.isNetworkConnected(CreateGroupActivity.this)) {
         new CreateGroupTask()
             .execute(
                 uid,
                 et_group_name.getText().toString(),
                 et_group_intro.getText().toString(),
                 num);
       } else {
         ShowToast.toast(CreateGroupActivity.this, "请连接网络再试");
       }
       System.out.println("111111111" + num);
       break;
   }
 }