Android ACTION_VIEW Multiple Images

前端 未结 1 956
囚心锁ツ
囚心锁ツ 2021-01-19 04:31

I have between one and three photos I\'d like my app to display. I won\'t know until runtime exactly how many photos are downloaded from the Internet.

I can\'t figu

相关标签:
1条回答
  • 2021-01-19 05:04

    I think your goal is out of your control. If the viewer app is designed to handle mutiple images or a directory, you may ask it to show as you want, but you are defined to the viewer's pattern.

    I have installed a third-party image viewer called QuickPic. I just tested your code snippet and the system popped up a chooser dialog to let me select the app to show the images in the folder. If I select native gallery, what I see is just an empty folder, while the Quickpic works as I want.

    PS: I tell my app the Uri of the folder this way:

    intent.setDataAndType(Uri.fromFile(new File("//mnt/sdcard/test/")), MimeTypeMap.getSingleton().getMimeTypeFromExtension("png"));
    
    0 讨论(0)
提交回复
热议问题