This commit is contained in:
Alex Sytnyk 2018-08-28 19:20:30 +03:00
parent e46e4c37f9
commit c571408815
2 changed files with 3 additions and 4 deletions

View file

@ -108,7 +108,7 @@ public class ImportHelper {
return false; return false;
} }
public void handleFavouritesImport(Uri uri) { public void handleFavouritesImport(@NonNull Uri uri) {
String scheme = uri.getScheme(); String scheme = uri.getScheme();
boolean isFileIntent = "file".equals(scheme); boolean isFileIntent = "file".equals(scheme);
boolean isContentIntent = "content".equals(scheme); boolean isContentIntent = "content".equals(scheme);

View file

@ -141,9 +141,8 @@ public class FavoritesActivity extends TabActivity {
} }
} }
} else if (requestCode == IMPORT_FAVOURITES_REQUEST && resultCode == Activity.RESULT_OK) { } else if (requestCode == IMPORT_FAVOURITES_REQUEST && resultCode == Activity.RESULT_OK) {
if (data != null) { if (data != null && data.getData() != null) {
Uri uri = data.getData(); importHelper.handleFavouritesImport(data.getData());
importHelper.handleFavouritesImport(uri);
} }
} else { } else {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);