我正在使用 Scringo 在我的 Android 应用程序中实现群聊。有没有办法通过代码打开一个特定的聊天室?现在,从示例应用程序和 API 中,我只找到了以下代码。
Scringo.openChatRooms(MainActivity.this);
请让我知道我该怎么做
- 以编程方式创建聊天室
- 以编程方式打开特定的聊天室。
这段代码解决了我的问题:
MainActivity.java
public class MainActivity extends Activity {
private Scringo scringo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
scringo = new Scringo(this);
...
findViewById(R.id.openChatRoomButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Scringo.openChatRooms(MainActivity.this);
}
});
...
}
主要的.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
...
<Button
android:id="@+id/openChatRoomButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:text="@string/open_inbox_button_text" />
</RelativeLayout>
目前 Scringo SDK 不提供以编程方式打开聊天室的方法。他们有自己的屏幕(活动)来管理多对多聊天功能。他们尚未在其 Android SDK 上集成以下功能。1. 以编程方式创建聊天室 2. 以编程方式加入/打开聊天室
资料来源:我收到了他们支持团队的回复。他们声称此功能可用于他们的 IOS sdk。我不确定。