Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我写了一个简单的应用程序,并想包括一张来自用户手机的照片。他们会被要求在手机上选择一张照片......任何人都可以就我如何做到这一点提供任何建议或有用的建议。这是我的第一个应用程序,所以我对这方面的知识并不十分了解。
使用带有 onclicklistener() 的按钮,并在循环中添加此代码。
Intent galleryIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(galleryIntent, Constants.REQ_CODE_PICK_IMAGE);