commit
c9ef2d37bb
|
@ -172,9 +172,20 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity {
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (resultCode == RESULT_OK && requestCode == CHOOSE_OPML_FILE) {
|
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));
|
startImport(new File(filename));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue