
TUIKit or TUIConversation.login API in TUILogin to log in to the component.<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/conversation_view" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout>
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); TUIConversationMinimalistFragment fragment = new TUIConversationMinimalistFragment(); getSupportFragmentManager() .beginTransaction() .add(R.id.conversation_view, fragment) .commitAllowingStateLoss(); } }
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); TUIConversationFragment fragment = new TUIConversationFragment(); getSupportFragmentManager() .beginTransaction() .add(R.id.conversation_view, fragment) .commitAllowingStateLoss(); } }
TUIConversationMinimalistFragment will show an empty list. For a better experience, it's recommended to send messages to some accounts first to trigger the creation of conversations. If you want to know how to send messages in the chat interface, please refer to the document: Build Chat Interface.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan