Android QQ pictures to achieve the effect of photo selection
This example shares the QQ picture implemented by Android and the specific code of photo selection for your reference. The specific contents are as follows
Effect display
The layout is very simple. A GridView can be directly used for layout:
layout/activity_ add_ photo.xml
layout/activity_ add_ photo_ gv_ Items.xml uses a custom view to make the layout square
code implementation
SquareRelativeLayout.java:
Uploadphotoactivity.java: main activity
Imagetool.java: image tool class
Because the image URI obtained by Android version 4.4 or above is com.xxxxx, you need to make a judgment in the tool class, otherwise you can't get the absolute address of the image.
Tools refer to a blog of others and forget to leave the blog address. Please forgive the original blogger.
Finally, you need to add a permission:
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.