位置: 编程技术 - 正文

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 框架)

  • 进项留抵转出会计分录
  • 资产的计税基础大于账面价值会形成可抵扣的暂时性差异
  • 出口结汇必须要开票吗
  • 小微企业城建税及附加减半
  • 工程结算扣罚款怎么开票
  • 成本核算的三种基本方法
  • 资本化研发费用在本年的摊销
  • 收到捐赠货物的会计分录怎么写
  • 购进免税农产品怎么计算进项税额
  • 材料采购成本差异属于什么科目
  • 收的标书收入增值税多少
  • 增值税发票抵扣期限最新规定
  • 长期借款费用资本化
  • 公司注销未缴纳社会保险费
  • 安置房视同销售需要缴纳所得税吗?
  • 土地溢价的成本包括
  • 电子普通发票怎么开
  • led电子屏税收编码
  • mac系统如何开启任何来源
  • 广告费和业务宣传费
  • 费用报销单正确填写格式
  • 研发费用的归集范围
  • 所得税汇算清缴时间期限
  • 要求快速启动
  • 在win7系统中文件属性有哪些
  • 给实习生发放工资怎么纳税?
  • 关联企业之间销售货物
  • PHP:pg_connect_poll()的用法_PostgreSQL函数
  • PHP:zip_entry_open()的用法_Zip函数
  • vuex model
  • 差额征税专用发票税额怎么算
  • 增值税申报表上期留抵税额怎么填
  • 生物制品简易征收文件
  • 小规模纳税人开专票需要交税吗
  • 对标是啥
  • html流光按钮
  • jquery教程chm
  • 计算机视觉opencv项目简单代码
  • checksum 命令
  • 税务局退还的三种税费
  • 如何扣除企业接单费用
  • mongodb bi
  • 成立一般纳税人公司流程
  • macos添加用户
  • 工会经费与残保金属于什么
  • 发行股票时支付的手续费
  • 固定资产盘亏如何做账务处理
  • 商业承兑汇票风险高吗
  • 外贸公司是不是什么都做的?
  • 写字楼里的公司怎么赚钱
  • 坏账确认无法收回
  • 公司房产税如何避税
  • 交易性金融资产的入账价值
  • 给员工家人报销会计分录
  • 租房发票如何做分录
  • 收到的劳务发票怎么做账
  • 政府部门有税务和审计审查吗
  • 企业存货会计分录
  • 商品流通企业如何控成本
  • sqlserver代理无法启动怎样办
  • 指定为fvtpl
  • mysqli修改表中数据
  • win8.1应用
  • win7 64位系统玩英雄联盟lol频繁提示failed to create dump file error 183的解决方法
  • win8 休眠
  • win7系统打印机服务开启
  • perl中splice
  • js基于贪心算法实验报告
  • nodejs基础知识
  • jquery可编辑表格插件
  • webpack配置文件在哪
  • jQuery leonaScroll 1.1 自定义滚动条插件(推荐)
  • javascript总结笔记
  • jquery弹出窗口
  • android实现侧边栏
  • 怎么打印纳税申报单
  • 湖南省国家税务总局官网登录入口
  • 卷烟批发环节的税率
  • 航天信息的金税盘开票要怎么调格式
  • 国家税务局宝鸡市税务局
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设