我试图Dropbox的选择器插入式API集成到我的应用程序。我遇到了一个不正常的问题。在我的应用程序,当我启动dbx的选择器,任何时候,我选择一个文件的应用程序失败,出现以下错误代码:
抱歉,发生错误了。请稍后再试。
这是一个实现的Dropbox API的我的代码部分。的代码的该部分是在收存箱的API被初始调用。
public void StartDropboxApplication() {
// create the chooser
DbxChooser chooser = new DbxChooser(APP_KEY);
DbxChooser.ResultType result;
// determine which mode to be in // TODO REMOVE ALL BUT FILE CONTENT TODO SIMPLIFY by making this a setting
switch(( (RadioGroup) ParentActivity.findViewById(R.id.link_type)).getCheckedRadioButtonId() ) {
case R.id.link_type_content:
result = DbxChooser.ResultType.DIRECT_LINK;
break;
default:
throw new RuntimeException("Radio Group Related error.");
}
// launch the new activity
chooser.forResultType(result).launch(ParentActivity, 0);
}
这里是位置代码应该然后把它捡起来,尽管这不可能发生。
protected void onActivityResult( int request, int result, Intent data ) {
Log.i(fileName, "result: " + result);
// check to see if the camera took a picture
if (request == 1) {
// check to see if the picture was successfully taken
if (result == Activity.RESULT_OK) {
onPicture();
} else {
Log.i(fileName, "Camera App cancelled.");
}
} else if (request == 0) {
if ( result == Activity.RESULT_OK ) {
onDropbox(data);
} else {
Log.i(fileName, "dropbox related issue.");
}
}
}
感谢您的帮助,或者你能够提供建议。
我能解决我自己的问题,并得到这个工作。在关闭的机会,别人也有类似的问题,我会详细的解决方案。第一个问题是我是我的APP_KEY是不正确的。
接下来的问题是,我试图从直接的联系,而不是内容链接阅读。直接链接提供了一个链接到文件Dropbox的服务器上的应用,而内容链接提供的文件的高速缓存版本的应用程序。如果该文件不存在的设备上,该SDK下载一个副本给你。