位置: 编程技术 - 正文

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

  • 加油站购进成品油怎么做账
  • 计提企业所得税会计科目
  • 工商年报多久能显示
  • 主营业务成本借方表示什么意思
  • 工程施工的材料购进计入哪里
  • 住宿报销是开普票还是专票
  • 劳务公司开票税收分类
  • 赔偿款能否税前抵扣
  • 作家以及作品
  • 应付票据的处理
  • 增值税留抵税额抵减欠税
  • 不得抵扣的进项税额的情形有
  • 融资租入固定资产属于资产吗
  • 发票开的是推广服务费计入什么费用?
  • 集体土地上的不动产证已经能查询为何房产证拿不到
  • 税务需要申报吗
  • 安装服务异地施工增值税在哪交
  • 物业管理行业税点
  • 小微企业不超过300万所得税
  • 购入苗木的会计分录
  • 企业取得免税收入怎么算
  • 公司的班车费用怎么入账
  • 预提差率费怎么记账
  • a107040减免所得税优惠明细表2020
  • 预借现金和现金分期的区别
  • 其他收益科目核算
  • win10自带的照片查看器
  • 回收站右键菜单修改
  • 专用发票抵扣和免税区别
  • 华硕笔记本电脑售后维修服务网点
  • window清除临时存储文件夹
  • window10 锁屏壁纸
  • 金枝玉叶怎么养才爆盆
  • 企业接受现金捐赠要交税吗
  • 朱砂矿洞的历史
  • vue3.0优点
  • smart模板教程
  • idea2020.2.3创建web
  • icse论文
  • php跨域提交表单
  • 缴纳医疗保险费会计分录
  • 帝国cms8.0
  • 织梦相关文章调用
  • dedecms建站操作
  • 航天信息发票怎么抵扣
  • 退货开具红字发票说明
  • mysql修改密码的命令
  • 印花税计税依据和税率
  • 红冲暂估原材料如何做会计分录
  • 慰问金计入什么部门经济分类
  • 事业单位对外投资
  • 自营工程领用自产产品的处理
  • 暂估费用票的账务处理
  • 用友软件冲销之前凭证怎么操作
  • 事业单位收到钱怎么记账
  • 财务费用中的利息费用指什么
  • Win10 Build 17035自制64位中国版十合一ISO镜像下载地址
  • windows7手写功能
  • mac系统如何隐藏文件
  • linux的awk命令大全
  • linux ll不能用
  • winxp的控制面板在哪里
  • WIN7系统如何恢复出厂系统
  • win7禁用administrator
  • linux网络设置在哪里
  • 升级win10系统错误代码0x80072F8F
  • windows7默认网关不可用
  • cocos2dx环境搭建
  • android颜色值
  • python str()怎么用
  • unity2018.4破解
  • pythen开发环境
  • 公益性捐赠支出属于什么会计科目
  • [转]决算中甲供材如何扣除?
  • 湖南低保查询网上查询
  • 仓储物流用地属于商业用地吗
  • 契税和耕地占用税由谁负责征收
  • 内蒙古国家税务总局电子税务局官网
  • 欠税多久法院立案
  • 2020北京户口指标数量
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设