![](/img/trans.png)
[英]how I can select multiple images from gallery in android studio
[英]How can I have a user select multiple images from the gallery, and as they are selected have them put into a queue in order?
這是按下我的按鈕時打開圖庫的代碼。
public void openGallery(View v){
if (v.getId() == R.id.GALLERY){
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
}
}
這段代碼可以打開畫廊,但是當用戶按下他們想要的圖片時,是否有辦法將這些圖片按用戶按下的順序放入隊列中?
有沒有辦法將這些圖片按用戶按下的順序放入隊列中?
否。如果需要,請不要使用ACTION_GET_CONTENT
,而是創建自己的畫廊風格的UI,在其中可以完全控制用戶交互。
或者,不必擔心ACTION_GET_CONTENT
的順序,而是讓用戶以正確的順序將圖像放在您自己的UI中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.