Merge pull request #830 from CWftw/develop

Fixed import Google Drive
This commit is contained in:
Tom Hennen 2015-05-25 20:33:23 -04:00
commit c9ef2d37bb
1 changed files with 13 additions and 2 deletions

View File

@ -172,9 +172,20 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity {
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == CHOOSE_OPML_FILE) {
String filename = data.getData().getPath();
Uri uri = data.getData();
if ("content".equals(uri.getScheme())) {
try {
Reader mReader = new InputStreamReader(getContentResolver().openInputStream(uri), LangUtils.UTF_8);
startImport(mReader);
} catch (FileNotFoundException e) {
Log.d(TAG, "File not found");
}
} else {
String filename = uri.getPath();
startImport(new File(filename));
}
}
}
}