位置: 编程技术 - 正文

Fragment中调用onActivityForResult处理(fragment的context)

编辑:rootadmin

推荐整理分享Fragment中调用onActivityForResult处理(fragment的context),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:fragment如何调用activity中的方法,fragment not attach context,fragment调用activity方法,fragment怎么用,fragment add replace,fragment调用activity方法,fragment调用另一个fragment,fragment onclick,内容如对您有帮助,希望把文章链接给更多的朋友!

The activity hosting this fragment has its onActivityResult called when the camera activity returns

My fragment starts an activity for result with the intent sent for the camera to take a picture. The picture application loads fine, takes a picture, and returns. The onActivityResult however is never hit. I’ve set break points but nothing is triggered. Can a fragment have onActivityResult? I’d think so since its a provided function. Thoughts on why this isn’t being triggered?

So I figured out the problem and will post the answer for anyone else experiencing this issue. The hosting activity overrode the onActivityResult but did not make a call to super.onActivityResult for unhandled result codes. Apparently even though the fragment is the one making the startActivityForResult call, the activity gets the first shot at handling the result. This makes sense when you consider the modularity of fragments. Once I implemented super.onActivityResult for all unhandled results, the fragment got a shot at handling the result.

Fragment中调用onActivityForResult处理(fragment的context)

And also from @siqing answer

To get the result in your fragment make sure you call : startActivityForResult(intent,);instead of getActivity().startActivityForResult(intent,); inside your fragment.

解决方法就是: 在Fragment中直接调用startActivityForResult()方法, 而不是调用 getActivity().startActivityForResult()。

stackoverflow

Android Volley框架的使用(二) 在上一篇文章中介绍了volley框架的特性,如何将volley.jar引入我们的项目,以及volley框架中最常用的两个类RequestQueueRequest基本的使用方法;这篇介绍Volley

android 一个集合问题导致不得不说的故事 啥也不说,先看图,然后给你讲需求!技能中只能添加三项,如果选择超过三个就给提示,选中的可以再次点击就是删除,这个肯定不难,但是做着发现一个问题,

Activity的四种启动模式和onNewIntent() 转自:

标签: fragment的context

本文链接地址:https://www.jiuchutong.com/biancheng/374516.html 转载请保留说明!

上一篇:JavaScript文件处理:文件读取(js的文件操作)

下一篇:Android Volley框架的使用(二)(android app 框架)

  • 减资 股东
  • 支付客户劳务费怎么操作
  • 融资租入的固定资产需要计提折旧吗
  • 股东归还公司借款,应该记什么科目
  • 餐费可以抵扣吗
  • 汇算清缴所得税补缴怎么处理
  • 普票丢失了能作废重开吗
  • 现金日记账划线更正法
  • 环保专项资金可以转让吗
  • 怎么分清复利和年金
  • 期初建账以前年度损益调整怎么转?
  • 分项结转分步法例题及分录
  • 建安业核定征收利润率
  • 支付境外销售佣金怎么做
  • 价内税和价外税区别
  • 补贴收入需要缴纳增值税吗为什么
  • 内账价税分离余额怎么处理
  • 金融业营业税改增值税
  • 金融保险服务业
  • 土地增值税计税依据
  • 当期可抵扣进项税额包括进项转出额吗
  • 增值税专票怎么认证
  • 来料加工的生产企业
  • 报表中在产品填什么数据
  • 子公司代发母公司人员工资
  • 租用服务器会泄漏数据吗
  • 分公司需要计提利息吗
  • 副调基金的会计分录怎么做?
  • 华为nova9值得买吗知乎
  • mac上安装homebrew
  • 为什么叫win7
  • win10如何打开regedit
  • php数组函数,选班长
  • PHP:pg_last_notice()的用法_PostgreSQL函数
  • cnqmax.exe进程的详细注解 cnqmax进程是病毒吗 安全吗
  • 固定资产加速折旧方法
  • 分配水电费会计分录需要写税吗?
  • 潘塔纳尔湿地位于巴拉圭盆地
  • php rsa
  • 总分类账的登记依据和方法取决于企业所采用的
  • yolov5标签格式
  • k8s kubelet
  • 职工教育经费是否可以抵扣进项税
  • python 微信
  • 印花税申报未扣款在哪里查询
  • 软件和集成电路企业
  • 小规模纳税人要缴纳哪些税
  • 认缴出资和注册资本
  • 投标保证金退还时间是在什么文件的规定的
  • python分布式执行框架Ray的介绍
  • 付了工资的资产负债表怎么填
  • 确认收入的时点包括
  • 取得股票期权的个人所得税问题
  • 企业技术服务费比例
  • 租赁的生产设备计入哪个科目
  • 单位伙房费用管理制度
  • 离岸服务外包收入
  • 税法规定固定资产最低折旧年限
  • 事业单位会计岗位属于哪一类
  • 职工福利费核算哪些内容
  • 任务栏都不见了
  • windows电脑加速
  • linux安装iso软件
  • android-x86安装
  • win8系统启动不了如何修复
  • 如何手动设置定位
  • 微软正式推出wind...
  • win7安全更新kb4534314
  • bootstrap paginator分页插件的两种使用方式实例详解
  • android内存优化 简书
  • opengl es3.0
  • activitythread main方法
  • dos替换文件命令
  • 脚本合集
  • python运行py文件没反应
  • JavaScript中的数据类型分哪为两大类?
  • android下的单元测试要配置以下说法不正确的是
  • 城市配套费需要什么资料
  • 国税地税征管体制改革方案全文
  • 微信 税务
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设