# Please help me on this

**URL:** <https://community.sendbird.com/t/please-help-me-on-this/2382>\
**Category:** Sendbird Chat UIKit\
**Tags:** android\
**Created:** [June 1, 2021, 3:43pm UTC](https://community.sendbird.com/t/please-help-me-on-this/2382 "2021-06-01T15:43:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [June 1, 2021, 3:43pm UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/1 "2021-06-01T15:43:01Z")

</div>

I am trying to create a new group channel from my fragment… please see this below code…

```java
GroupChannelParams params = new GroupChannelParams()
        .setPublic(false).setEphemeral(false)
        .setDistinct(true).setSuper(false)
        .addUserIds(users).setOperatorUserIds(operators);
GroupChannel.createChannel(params, new GroupChannel.GroupChannelCreateHandler() {
    @Override
    public void onResult(GroupChannel groupChannel, SendBirdException e) {
        if (e != null) {
            e.printStackTrace();
        }
        String channelUrl = groupChannel.getUrl();
        /*Intent intent = new Intent(getActivity(), GroupChannelMainActivity.class);
        intent.putExtra(PUSH_REDIRECT_CHANNEL, channelUrl);
        startActivity(intent);*/
        Intent intent = CustomChannelActivity.newIntentFromCustomActivity(getActivity(), CustomChannelActivity.class, channelUrl);
        startActivity(intent);
        getActivity().finish();
    }
});

```

so this code is perfectly working if the android studio is in debug mode…but if the code is in Run, this throws an exception saying the user is not connected, Connection must be made.

any clue, why this code is not working in run mode, but success in debug mode…seems some delayed response causing problem…please help me

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [June 1, 2021, 8:37pm UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/2 "2021-06-01T20:37:16Z")

</div>

Hi @sakkk,

Is there any potential for your connection to be delayed while not in debug mode? It seems like the most logical way forward would be to wait until the connection has been made to make your calls.

---

<div class="post-metadata">

**Author:** ![Doo\_Rim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/doo_rim/32/239_2.png) [@Doo\_Rim](https://community.sendbird.com/u/Doo_Rim)\
**Post date:** [June 2, 2021, 2:11am UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/3 "2021-06-02T02:11:58Z")

</div>

Hi, @sakkk  
Could you let me know where you put your codes?!  
Our UIKit fragment components try to connect Sendbird server when onViewCreated calls.

1. Do you use our UIKit fragment? → Then, you need to call your codes after `onReady()`
2. Do you use your own fragment? → You should implement `connect()`

---

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [June 2, 2021, 3:39am UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/4 "2021-06-02T03:39:26Z")

</div>

> [@Doo\_Rim](#):
>
> onReady()

You mean, SendBirdUIKit.connect((user, e) → {}  
I implemented this connect before the channel creation, but even though I am facing the problem…I have my own fragment, from that fragment I am calling the above-said codes.

---

<div class="post-metadata">

**Author:** ![Doo\_Rim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/doo_rim/32/239_2.png) [@Doo\_Rim](https://community.sendbird.com/u/Doo_Rim)\
**Post date:** [June 2, 2021, 7:13am UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/5 "2021-06-02T07:13:46Z")

</div>

Did you implement the channel creation code after `connect()` callback succeeded?

---

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [June 2, 2021, 7:14am UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/6 "2021-06-02T07:14:37Z")

</div>

can you please share a code snippet for this connect() callback …it would be helpful

---

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [June 3, 2021, 4:18am UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/7 "2021-06-03T04:18:09Z")

</div>

Any update on this …?

---

<div class="post-metadata">

**Author:** ![Doo\_Rim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/doo_rim/32/239_2.png) [@Doo\_Rim](https://community.sendbird.com/u/Doo_Rim)\
**Post date:** [June 3, 2021, 4:32am UTC](https://community.sendbird.com/t/please-help-me-on-this/2382/8 "2021-06-03T04:32:45Z")

</div>

@sakkk

```auto
// The USER_ID below should be unique to your Sendbird application.
SendBird.connect(USER_ID, new SendBird.ConnectHandler() {
    @Override
    public void onConnected(User user, SendBirdException e) {
        if (e != null) {
            // Handle error. 
        }
        // The user is connected to Sendbird server.    
        // Attach your codes.
    }
});

```
