I am developing a chat application using ASMACK. I am able to connect and send messages for private chat.However, when trying to create a chat room i get the error:
item-not-found(404)
This is the code i am using:
setConnection(connection);
if(connection != null)
{
try
{
// SmackAndroid.init(this);
MultiUserChat muc=new MultiUserChat(connection,"chat1@groupchat.google.com");
muc.create("greatandroid");
Log.d("Chat Room Created","Successfully Created Chat Room");
Form form = muc.getConfigurationForm();
Form submitForm = form.createAnswerForm();
for (Iterator fields = form.getFields();fields.hasNext();){
FormField field = (FormField) fields.next();
if(!FormField.TYPE_HIDDEN.equals(field.getType()) && field.getVariable()!= null){
submitForm.setDefaultAnswer(field.getVariable());
submitForm.setAnswer("muc#roomconfig_publicroom", true);
muc.sendConfigurationForm(submitForm);
Log.d("Config Form Created","Successfully Configured Chat Form");
}
}
}
catch(Exception ex)
{Log.d("Error Creating Chat Room",ex.getMessage().toString());}}
How can i resolve this?