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.
我正在从子活动调用图库并在父活动组的 onActivityResult 方法中获取所选图像的路径,但我想在子活动的 ImageView 中显示所选图像。这该怎么做?
你会data从public void onActivityResult(int requestCode, int resultCode, Intent data)
data
public void onActivityResult(int requestCode, int resultCode, Intent data)
因此,您可以通过以下方式获得它:
Uri targetUri = data.getData(); imageView.setImageURI(targetUri);