Fragment 内嵌Fragment问题——Duplicate id tag null or parent id 0x0 错误解决方案

用 i18n 驯服标准文案:SAP Fiori elements 的 UI 文本本地化与可替换实践全景 本文系统介绍了SAP Fiori elements应用中UI文本本地化的全面解决方案。从框架层与应用层文本的分类原则出发,详细解析了标准文本替换的四步法:资源准备、键值定位、模型配置和验证部署。文章特别针对不同开发场景,提供了XML、ABAP CDS和CAP CDS三种注解方式的文本覆盖写法示例。同时深入探讨了语言回退机制、表格组件标准键覆盖等关键技术细节,并指出了实际项目中的常见问题与解决方案。通过结合官方文档和社区实践,为开发人员在不破坏框架约定的前提下,实现稳定可靠的UI文本本地化提供了完整指导。 阅读详情

在Fragment中如果内嵌了Fragment,那么在多次点击后内嵌的Fragment会遭成上述的问题Duplicate id  tag null or parent id 0x0,因此我们需要在Fragment的OnDestroyView方法中销毁内嵌的Fragment,这样就可以解决上述的问题,具体代码如下:

 

public class CopyOfSampleTitlesTriangle extends CopyOfBaseSampleFragment {
 
 private UserProfileFragment userProfileFragment;
 
 @Override

public void onDestroyView()
 {
  // TODO Auto-generated method stub
  super.onDestroyView();

 //内嵌的Fragment UserProfileFragment 
  UserProfileFragment userProfileFragment1 =(UserProfileFragment)getFragmentManager().findFragmentById(R.id.fr_user_profile_user_data_fragment);
  if(userProfileFragment1 !=null ){
   getFragmentManager().beginTransaction().remove(userProfileFragment1).commit();
  }


@Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
   Bundle savedInstanceState)
 {
  // TODO Auto-generated method stub
  //return super.onCreateView(inflater, container, savedInstanceState);
  View view = inflater.inflate(R.layout.fr_user_profile, null);
  mAdapter = new TestFragmentAdapter(getChildFragmentManager());

        mPager = (ViewPager)view.findViewById(R.id.pager);
        mPager.setAdapter(mAdapter);

        TitlePageIndicator indicator = (TitlePageIndicator)view.findViewById(R.id.viewpager_indicator);
        indicator.setViewPager(mPager);
        indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);
        mIndicator = indicator;
        
        final float density = getResources().getDisplayMetrics().density;
        //indicator.setBackgroundColor(0x18FF0000);
        
        indicator.setFooterColor(Color.WHITE);
        indicator.setFooterLineHeight(1 * density); //1dp
        indicator.setFooterIndicatorHeight(3 * density); //3dp
        //indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
        //indicator.setTextColor(0xAA000000);
        //indicator.setSelectedColor(0xFF000000);
        indicator.setSelectedBold(true);
        
        userProfileFragment =(UserProfileFragment)getFragmentManager().findFragmentById(R.id.fr_user_profile_user_data_fragment);
        
        //userProfileFragment =(UserProfileFragment)getChildFragmentManager().findFragmentById(R.id.fr_user_profile_user_data_fragment);
        User user=new User();
        user.fullName="test";
        user.description="test description";
        user.email="test@gmail.com";
        user.isFollowing=true;
        user.shortName="test";
       
        userProfileFragment.setUser(user);
       
  
  return view;
 }


 }


37、基于视觉的轻量级面部呼吸和心率测量技术 本文提出了一种基于视觉的轻量级面部呼吸和心率测量技术,通过远程光电容积脉搏波描记法(RPPG)和面部振动信息实现非接触式生理信号采集。创新性地结合框选和特征点选择多个感兴趣区域(ROI),并采用光流跟踪、主成分分析(PCA)和集成经验模态分解(EEMD)等方法优化信号处理流程。实验结果表明,该方法在测量精度和稳定性方面优于传统方法,并可在树莓派4等低功耗平台上实现实时运行,具有广泛的应用前景。 阅读详情

相关推荐

离线安装ambari 更换spark版本 集成carbondate文档

1、Linux系统环境配置 1.1 配置IP地址 vim /etc/sysconfig/network-script/ifcfg-eth0 “DEVICE”:网卡对应的设备别名,如ifcfg-eth0第一块网卡; “HWADDR”:网卡物理地址; “BOOTPROTO”:网卡获得ip地址的方式,Static(静态 ip地址)dhcp(通过dhcp协议获取ip)bootip通过boot...

weixin_44742962的博客 3035

重复ID,标签null或父ID,以及com.google.android.gms.maps.MapFragment的另一个片段

I have an application with three tabs. 我有一个带有三个标签的应用程序。 Each tab has its own layout .xml file. 每个

xfxf996的博客 600

PINN——加入物理约束的神经网络

【摘要】 基于物理信息的神经网络(Physics-informed Neural Network, 简称PINN),是一类用于解决有监督学习任务的神经网络,它不仅能够像传统神经网络一样学习到训练数据样本的分布规律,而且能够学习到数学方程描述的物理定律。与纯数据驱动的神经网络学习相比,PINN在训练过程中施加了物理信息约束,因而能用更少的数据样本学习到更具泛化能力的模型。本文主要解析这种神经网络以...

qq_39444290的博客 4582

Android实战技巧:Fragment的那些坑

来源:http://toughcoder.net/blog/2015/04/30/android-fragment-the-bad-parts/ Fragment是Android在3.0(Homeycomb)版本时加入的用以更灵活的构建多屏幕界面的可UI组件。关于Fragment以基本使用方法可以参考官方的教程和最佳实践,以及选择Activity还是Fragment。 但是F

l_215851356的专栏 2776

MDK开发篇:基于立创逻辑派FPGA-G1与Cortex-M1软核的按键控制LED实战

本文详细介绍了基于立创逻辑派FPGA-G1开发板与高云Cortex-M1软核的完整开发流程。通过Gowin云源软件配置软核系统与GPIO外设,并在Keil MDK环境中编写按键控制LED的C程序,最终实现程序固化与上电自启动。教程涵盖硬件配置、软件开发、在线调试与固化部署全步骤,帮助STM32开发者快速上手FPGA软核开发。

weixin_42103128的博客 147

美团外卖 mtgsig 1.2 逆向工程与补环境实战指南

本文深入解析了美团外卖核心风控参数mtgsig 1.2的生成机制与逆向实战。通过拆解其复杂的JSON结构,揭示了设备指纹、环境信息加密等关键字段。重点阐述了在Node.js中模拟浏览器环境(补环境)的核心方法,包括DOM/BOM对象、本地存储及Canvas/WebGL等高级指纹的模拟技巧,为安全研究和合规自动化测试提供了一套完整的技术指南。

uber9的博客 409

ILJMALL project过程中遇到Fragment嵌套问题:IllegalArgumentException: Binary XML file line #23: Duplicate id...

出现场景:当点击“分类”再返回“首页”时,发生error退出 BUG描述:Caused by: java.lang.IllegalArgumentException: Binary XML file line #23: Duplicate id 0x7f0d0054, tag null, or parent id 0xffffffff with another frag...

weixin_34376986的博客 245

数据工程师——ETL

文章摘要 ETL(数据抽取、转换、加载)是数据处理的核心流程,负责将分散数据源整合为高质量数据。ETL与ELT的主要区别在于转换步骤顺序,分别适用于不同规模数据场景。数据仓库通过ETL从多个数据源集成数据,支持分析决策。维度建模中的事实表记录业务指标,维度表提供上下文信息。缓慢变化维度(SCD)处理随时间变化的维度数据,常见类型包括直接覆盖型、新增版本型等。数据清洗解决数据缺失、重复、错误等问题,确保数据质量。数据血缘记录数据流转路径,便于问题排查和影响分析。常用ETL工具如Kettle通过转换和作业实现数

weixin_45729710的博客 1558

Duplicate id, tag null, or parent id 0x0 with another fragment 解决方案

前面一篇文章讲解了如何解决这个问题,但是同时引起了其他的问题,

瞎几把学 5216

IPV6基本配置

IPV6配置,DHCPV6,华为模拟器,IPV6的M/O标志位

路漫漫其修远兮 4665

OpenOCD入门到精通:第 4 章 配置文件体系详解

本文深入解析OpenOCD配置文件的体系结构和工作机制。首先介绍了配置文件的搜索路径优先级和加载顺序,以及配置阶段与运行阶段的区别。然后详细分析了interface配置文件的适配器参数调优方法,包括ST-Link、CMSIS-DAP和FTDI等常见调试器的配置示例。最后重点讲解了target配置文件的核心结构,包括TAP声明、目标创建和工作区设置等关键步骤,并以stm32f1x为例展示了完整的配置流程。通过本文可以全面了解OpenOCD配置文件的分层设计理念和参数化配置方法。

从事嵌入式linux android驱动开发,拥有全栈能力 594

Duplicate问题

219.Contains Duplicate II Given an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and theabsolutedifference be...

offerkkl的博客 1556

C#构建高精度预测模型:从数据预处理到模型部署的实战指南

【代码】C#构建高精度预测模型:从数据预处理到模型部署的实战指南。

墨夶的博客 1260

Fragment 内嵌Fragment问题——Duplicate id tag null or parent id 0x0 错误解决方式

在Fragment中假设内嵌了Fragment,那么在多次点击后内嵌的Fragment会遭成上述的问题Duplicate id tag null or parent id 0x0。因此我们须要在Fragment的OnDestroyView方法中销毁内嵌的Fragment。...

weixin_30681121的博客 257

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

IPSec ×××实验

IPSec ×××实验一,IKE协商.IKE协商跟TCP三次握手相似.不过比TCP 三次握手复杂点.IKE协商过程需要经过9个报文的来回,才能建立通讯双方需要的IKE SA,然后利用该IKE SA进行数据的加密和解密.IKE协商报文采用UDP格式,默认端口是500一,IKE协商的第一阶段:也称为IKE的主模式:1,A和B通讯,A作为发起方,第一个报文是A本地配置的policy...

weixin_33882452的博客 395

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Duplicate id 0x7f0900af, tag null, or parent id 0xffffffff with another frag

以下时具体报错信息 Caused by: android.view.InflateException: Binary XML file line #39: Binary XML file line #39: Error inflating class fragment Caused by: android.view.InflateException: Binary XML fi...

103style 1830

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

SWAN之ikev2协议compress-nat配置测试

本测试主要验证远程用户alice和VPN网关carol之间部署有NAT网关moon,以及远程用户bob与VPN网关carol之间部署有NAT网关sun的情况下的连接建立情况,以及IPComp压缩功能。而且测试了carol网关为远程用户alice和bob进行流量转发的情况。测试拓扑如下: 主机配置 alice的连接配置文件:ikev2/compress-nat/hosts/alice/etc/ip...

redwingz的博客 854

Duplicate id xxx, tag null, or parent id xxx with another fragment for xxxFragment

这个问题,是在使用其他sdk进行开发时出现的,觉得比较典型,记录下, 具体表现:首次进入问题界面ok,切换其他界面后,再次进入问题界面,应用终止 堆栈信息如下: Caused by: java.lang.IllegalArgumentException: Binary XML file line #50: Duplicate id 0x7f0c001e, tag null, or p

Rocky Kou的博客 2961

Fragment出现的BUG

1 Caused by: java.lang.IllegalArgumentException: Binary XML file line #25: Duplicate id 0x7f070193, tag null, or parent id 0x0 with another fragment for xxxx 解决方法:

南魂09 731

fragment第二次载入就报错

fragment第二次载入就报错 1、布局中加入一个 2、查到原因Caused by: java.lang.IllegalArgumentException: Binary XML file line #8: Duplicate id 0x7f0e0096, tag null, or parent id 0xffffffff with another fragment for

X小飞侠的博客 1232

Fragment跳转——如何获取Fragment Id

有个需求,大概就是点击FragmentA的按钮跳转到FragmentB,搜了一下,解决方法是这样的: 1 @Override//核心代码 2 public void onClick(View v) { 3 //获取fragment的实例 4 Fragment fragment=new Fragment(); 5 //获取Fragment的管理器 6 FragmentManager fragmentManager=ge

sinat_31131353的博客 1643

流量控制Netlink接口

netlink消息接口注册 显然,netlink接口应该支持流量控制中三个组件的增加、删除和查询操作。对排队规则、类的接口注册在pktsched_init()中完成;对过滤器的接口的注册在tc_filter_init()中完成。 static int __init pktsched_init(void) { // 注册pfifo和bfifo两种排队规则 register_qdisc(&...

九天小哥的专栏 1163

Fragment内使用Adapter时this报错

解决方案:参考https://www.oschina.net/question/2307541_236502 将this改为getActivity() 使用宿主的context context上下文这一块感觉还是不太清楚云里雾里 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // I

bszy_000的博客 637

Android Fragment使用(二) 嵌套Fragments (Nested Fragments) 的使用及常见错误

嵌套Fragment的使用及常见错误 嵌套Fragments (Nested Fragments), 是在Fragment内部又添加Fragment. 使用时, 主要要依靠宿主Fragment的 getChildFragmentManager() 来获取FragmentManger. 虽然看起来和在activity中添加fragment差不多, 但因为fragment生命周期及管理恢复模式不同, ...

weixin_33805743的博客 1223

静态使用Fragment报错解决

学费系列——布局导致app出现闪退问题

Pandafz的博客 2914

getSupportFragmentManager方法报红

在项目中使用Fragment的时候出现,使用的getSupportFragmentManager()这个方法并不能进行应用,一度网上搜索之后 app包下FragmentManager用 Fragmentmanager fragmentManager=getFragmentManager(); v-4包的FragmentManager用 FragmentManager fragment...

徐代龙的技术专栏 1万+
上一篇: Can't Find Theme.AppCompat.Light 错误修改
下一篇: Fragment中调用SimpleAdapter问题
hack8
博客等级 码龄18年 109粉丝 128原创
评论 8
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值