英文:
Displaying multiple camera images to Grid view
问题
我想在网格视图中显示由相机捕获的多张图像。我查阅了许多关于如何做的问题,但没有一个完全适用于我。我使用这个来实现。但是使用这个方法,我能够在我的图像视图中获取图像,但是每当我捕获新图像时,该图像就会替换我的旧图像。现在我不知道该怎么办,以便将相机图像逐个添加到网格视图中。如果有人知道如何实现这一点,请用示例代码帮助我。提前谢谢。
英文:
i want to display multiple images capture by camera to Grid view. i go through many questions how to do but non perfectly work for me. i use This to implement. but using this i am able to get the image in my image view but whenever i capture new image that image replace my older image. and now i am clue less what should i do to add camera images one after another. anyone know how to implement this then please help me with sample code. thank you in advance.
答案1
得分: 1
使用此链接中答案中提供的注释:
https://stackoverflow.com/questions/60985137/showing-camera-capture-image-to-gridview
这应该能满足您的需求。希望这对您有所帮助。如果您遇到任何问题,请告诉我。
您在onActivityResult中维护一个列表。将列表初始化为类变量,即
ArrayList<Contact> imageArry = new ArrayList<Contact>();
在类定义后,在声明变量时添加此行。这样应该可以让您添加多张图片。
英文:
Use the comment provided in the answer in this link:
https://stackoverflow.com/questions/60985137/showing-camera-capture-image-to-gridview
This should serve your purpose. Hope this helps. Let me know if you face any issues
You maintain a list out the onActivityResult. Initialize the list as a class variable means
ArrayList<Contact> imageArry = new ArrayList<Contact>();
add this line after class definition when you declare your variables. That should make you add multiple images
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论