File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 2626 "tns-core-modules" : " ^4.0.0"
2727 },
2828 "devDependencies" : {
29- "@angular/compiler-cli" : " ~6.1.0-beta.1" ,
3029 "babel-traverse" : " 6.24.1" ,
3130 "babel-types" : " 6.24.1" ,
3231 "babylon" : " 6.16.1" ,
4241 "tns-platform-declarations" : " ^3.0.0" ,
4342 "tslint" : " ~5.4.3" ,
4443 "typescript" : " ~2.7.2" ,
45- "zone.js" : " ^0.8.4" ,
46- "@ngtools/webpack" : " 6.1.0-rc.0"
44+ "zone.js" : " ^0.8.4"
4745 },
4846 "scripts" : {
4947 "build.plugin" : " cd ../src && npm run build" ,
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ class UriHelper {
2626 // DownloadsProvider
2727 else if ( UriHelper . isDownloadsDocument ( uri ) ) {
2828 id = DocumentsContract . getDocumentId ( uri ) ;
29+ // Since Oreo the downloads id may be a raw string,
30+ // containing the file path:
31+ if ( id . indexOf ( "raw:" ) !== - 1 ) {
32+ return id . substring ( 4 , id . length ) ;
33+ }
2934 contentUri = android . content . ContentUris . withAppendedId (
3035 android . net . Uri . parse ( "content://downloads/public_downloads" ) , long ( id ) ) ;
3136
@@ -196,8 +201,8 @@ export class ImagePicker {
196201 intent . putExtra ( "android.intent.extra.ALLOW_MULTIPLE" , true ) ;
197202 }
198203
199- intent . setAction ( Intent . ACTION_GET_CONTENT ) ;
200-
204+ intent . putExtra ( android . content . Intent . EXTRA_LOCAL_ONLY , true ) ;
205+ intent . setAction ( "android.intent.action.OPEN_DOCUMENT" ) ;
201206 let chooser = Intent . createChooser ( intent , "Select Picture" ) ;
202207 application . android . foregroundActivity . startActivityForResult ( intent , RESULT_CODE_PICKER_IMAGES ) ;
203208 } ) ;
You can’t perform that action at this time.
0 commit comments