|
3 | 3 | import android.content.Intent; |
4 | 4 | import android.content.res.ColorStateList; |
5 | 5 | import android.os.Bundle; |
6 | | -import android.util.Log; |
7 | 6 | import android.view.View; |
8 | 7 | import android.widget.LinearLayout; |
9 | 8 | import android.widget.Toast; |
|
12 | 11 | import androidx.appcompat.widget.AppCompatImageView; |
13 | 12 | import androidx.core.content.ContextCompat; |
14 | 13 |
|
15 | | -import com.cometchat.chatuikit.extensions.ExtensionConstants; |
16 | 14 | import com.cometchat.chatuikit.shared.cometchatuikit.CometChatUIKit; |
17 | 15 | import com.cometchat.chatuikit.shared.cometchatuikit.UIKitSettings; |
18 | 16 | import com.cometchat.chatuikit.shared.resources.utils.Utils; |
19 | 17 | import com.cometchat.chat.core.CometChat; |
20 | 18 | import com.cometchat.chat.exceptions.CometChatException; |
21 | 19 | import com.cometchat.javasampleapp.AppConstants; |
22 | 20 | import com.cometchat.javasampleapp.AppUtils; |
| 21 | +import com.cometchat.javasampleapp.Application; |
23 | 22 | import com.cometchat.javasampleapp.R; |
24 | 23 | import com.cometchat.chat.models.User; |
25 | 24 | import com.google.android.material.card.MaterialCardView; |
@@ -49,11 +48,11 @@ protected void onCreate(Bundle savedInstanceState) { |
49 | 48 | @Override |
50 | 49 | public void onSuccess(String s) { |
51 | 50 | if (CometChatUIKit.getLoggedInUser() != null) { |
| 51 | + Application.addCallListener(MainActivity.this); |
52 | 52 | AppUtils.fetchDefaultObjects(); |
53 | 53 | startActivity(new Intent(MainActivity.this, HomeActivity.class)); |
54 | 54 | finish(); |
55 | 55 | } |
56 | | - CometChat.setSource("ui-kit", "android", "java"); |
57 | 56 | } |
58 | 57 |
|
59 | 58 | @Override |
@@ -97,6 +96,7 @@ private void login(String uid) { |
97 | 96 | CometChatUIKit.login(uid, new CometChat.CallbackListener<User>() { |
98 | 97 | @Override |
99 | 98 | public void onSuccess(User user) { |
| 99 | + Application.addCallListener(MainActivity.this); |
100 | 100 | AppUtils.fetchDefaultObjects(); |
101 | 101 | startActivity(new Intent(MainActivity.this, HomeActivity.class)); |
102 | 102 | finish(); |
|
0 commit comments