找到一个随机从图片库图片库

由网友(青春为你更新)分享简介:我的工作,需要获得随机图片从Android设备上的画廊Android应用程序。问题是,我只能够找到,让用户选择他们想要的图片库进行交互的方式。I'm working on an android application that needs to obtain a random picture from the Gal...

我的工作,需要获得随机图片从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.

阅读全文

相关推荐

最新文章