我正在尝试使用quickblox api上传音频文件。我可以在我的Nexus 7上上传音频附件。问题是,当我尝试使用相同的代码上传音频文件,在其他可用的设备(华硕zenphone和Karbonn Android one),我得到quickblox响应异常。例外情况是"content_type太短(最少为5个字符),content_type无效"。请有人帮我解决这个例外。我在下面的代码块中遇到异常。
/**
* This method will invoke when user try to upload a file in the chatbox.
*
* @param dialogId
* @param inputFile
* @param messageId
* @return
* @throws Exception
*
**/
public QBFile loadAttachFile(String dialogId, final File inputFile, final String messageId) throws Exception {
QBFile file = null;
try {
file = QBContent.uploadFileTask(inputFile, true, (String) null,
new QBProgressCallback() {
@Override
public void onProgressUpdate(int arg0) {
// TODO Auto-generated method stub
if (!lastUpdatedProgress.contains(arg0)) {
lastUpdatedProgress.add(arg0);
//Here we will update the progress of the progressbar details
updateAttachmentUploadingProgress(messageId, arg0);
}
}
});
} catch (QBResponseException exc) {
throw new Exception(context.getString(R.string.dlg_fail_upload_attach) );
}
return file;
}
这是'acc'文件格式和'android.webkit的问题。MimeTypeMap"类
QuickBlox已经发布了Android SDK 2.3版本的修复http://quickblox.com/developers/Android Framework_changelog
查看