android - 如何在不使用 onActivityResult 的情况下从 Activity 中获取结果

标签 android android-intent

我正在使用以下 Intent 调用我的相机来捕捉图像:

Intent imageIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

现在如果使用startActivityForResult() ,我能够获得结果数据,即捕获图片的 uri,然后我可以对该图片执行一些操作 onActivityResult() .

我的问题是,除了进入 onActivityResult() 之外,还有其他方法可以获取结果数据吗? .

最佳答案

My question is that is there any other way to get that resultant data other than going in onActivityResult().

不,对不起。从 startActivityForResult() 获取结果的唯一方法是通过 onActivityResult() 启动您未编写的 Activity 。

关于android - 如何在不使用 onActivityResult 的情况下从 Activity 中获取结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25343633/

相关文章:

android - rememberLauncherForActivityResult 抛出 Launcher 尚未在 Jetpack Compose 中初始化

android - 传递的 Intent 在 onStartCommand 中为 NULL 的原因

android - 谷歌播放说 : "You need to use a different package name" - why?

java - 多个 dex 文件使用 TMDb 依赖项定义 Ljavax/inject/Inject

java - 我可以更改屏幕底部后退箭头的功能吗?

java - Android程序修改

Android 通知小图片和大图片大小

android - 视频录制在 ICS 中不起作用

android - 从 fragment 中的包中将项目添加到 ListView

android - 从以特定方式开始和结束的 Web 链接启动 android 应用 Activity