我正在使用Scringo在我的Android应用程序中实现群聊。有什么方法可以通过代码打开特定的聊天室吗?现在,从示例应用程序和API中,我只找到了以下代码。
Scringo.openChatRooms(MainActivity.this);
请告诉我我该怎么做
发布于 2014-08-20 18:18:31
现在,Scringo并没有提供以编程方式打开聊天室的方法。他们有自己的屏幕(活动)来管理多到多聊天功能。他们还没有在他们的Android上集成以下特性。1.以编程方式创建聊天室2.以编程方式加入/打开聊天室
资料来源:我得到了他们的支援小组的回应。他们声称他们的IOS sdk可以使用这个特性。我不确定。
发布于 2014-08-20 12:37:57
这段代码解决了我的问题:
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);
}
});
...
}main.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>https://stackoverflow.com/questions/23223341
复制相似问题