Find a Random Picture from Gallery

2020-03-31 03:17发布

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.

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

1条回答
Animai°情兽
2楼-- · 2020-03-31 04:00

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.

查看更多
登录 后发表回答