如何从Android Gallery设置个人资料图片应用 [英] How to set profile picture app from Android Gallery
问题描述
我想要一种简单的方法,其中有一个代表用户个人资料图片的ImageView.如果他们没有选择照片,则将其设置为默认照片.
I want a simple way where there is an ImageView representing a user profile picture. It is set to a default photo if they have not picked one.
我希望他们只需单击它,它就会打开图库,他们可以设置(和裁剪)个人资料图片.该图片比在ImageView中设置的要多(并在下次打开该应用程序时保留在该图片上-我也正在使用Internet MySQL数据库进行连接,因此可能需要将图片存储在其中,以便其他用户可以看到.我只需要来了解Android的一面.
I would like them to simply click on it and it opens up the gallery and they can set (and crop) a profile picture. That picture than is set in the ImageView (and stays there the next time the app is opened -- I am also using an Internet MySQL database to connect to that I may need to store the picture in so other users can see. I just need to see the Android side of things).
我假设我可能需要使用某种Intent?我可以看到有关如何执行此操作的基本代码吗?
I am assuming I may need to use an Intent of some sort? Can I see basic code on how one might do this?
推荐答案
Here's a tutorial on using an intent with the Gallery: http://www.helloandroid.com/tutorials/gallery-intent-tutorial
这篇关于如何从Android Gallery设置个人资料图片应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!