找到一个随机从图片库 [英] Find a Random Picture from Gallery

查看:401
本文介绍了找到一个随机从图片库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,需要获得随机图片从Android设备上的画廊Android应用程序。问题是,我只能够找到,让用户选择他们想要的图片库进行交互的方式。

I'm working on an android application that needs to obtain a random picture from the Gallery on an android device. Problem is I've only been able to find ways of interacting with the gallery that allows the user to chose what picture they want.

任何人有任何想法,我应该做的,使这项工作? Java的code将是有益的。

Anybody has any ideas what I should do to make this work? Java code would be helpful.

推荐答案

我可能会使用的方法,则抛出的ID到一个数组,只需使用随机对象来获取一个随机整数从0到数组大小。

I would probably use this method, then throw the IDs into an Array and just use the Random object to get a random integer from 0 to array size.

这篇关于找到一个随机从图片库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆