【已解决】android.content.res.Resources$NotFoundException: String resource ID

OSPF路由协议配置 构建直连连通让R1、R2、R3、R4加入OSPF,实现全网互通。掌握OSPF邻居状态的解读。掌握单区域OSPF的配置。理解OSPF的基本概念。AR3上的OSPF配置。AR4上的OSPF配置。R1上的OSPF配置。R2上的OSPF配置。 阅读详情


01-23 17:03:05.212 27545-27545/com.wbm.app.activity E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: com.wbm.app.activity, PID: 27545
                                                                      android.content.res.Resources$NotFoundException: String resource ID #0x238c
                                                                          at android.content.res.Resources.getText(Resources.java:299)
                                                                          at android.support.v7.widget.ResourcesWrapper.getText(ResourcesWrapper.java:52)
                                                                          at android.widget.TextView.setText(TextView.java:4138)
                                                                          at com.wbm.app.utils.ui.AddNewWifiPrinter.<init>(AddNewWifiPrinter.java:52)
                                                                          at com.wbm.app.fragment.setting.PrinterFragment$4.onClick(PrinterFragment.java:164)
                                                                          at android.view.View.performClick(View.java:4785)
                                                                          at android.view.View$PerformClick.run(View.java:19884)
                                                                          at android.os.Handler.handleCallback(Handler.java:739)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                          at android.os.Looper.loop(Looper.java:135)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5343)
                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                          at java.lang.reflect.Method.invoke(Method.java:372)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)

                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)


原因是:

setText的时候里面的数是int类型的了,例如int里面的是1,那么它就回去查找resourse id=1的那个资源了,而不是直接设置字符串了


解决办法:

使用String.valueof()来包裹一下

mEditWIFIPort.setText(String.valueOf(GlobalVariable.WIFI_PORT));


30天入门 SAP BTP 开发系列之八:动手在 SAP BTP 上开发第一个 ABAP 透明表 ABAP Cloud 环境下创建透明表的方法与数据迁移实践 本文介绍了在 SAP BTP ABAP 环境中创建透明表并迁移数据的完整流程。与传统的 SE11 事务码不同,ABAP Cloud 需通过 ABAP Development Tool 创建数据库表,使用代码定义表结构。作者详细演示了如何: 在开发包中创建名为 Z优快云_TRAVEL 的透明表 使用 ABAP 代码定义表字段和约束 通过 ABAP 类实现数据从标准表/DMO/TRAVEL 到新建表的迁移 验证数据迁移结果 文中还提供了相关技术概念的 阅读详情

相关推荐

别再手动改文献了!手把手教你定制Mendeley的GB/T 7714-2005引用格式(附常见问题修复)

本文详细指导如何定制Mendeley的GB/T 7714-2005引用格式,解决科研文献管理中的常见问题。通过深度解析Mendeley样式编辑器,精准控制作者显示规则、出版社信息精简及期刊页码处理,实现参考文献一键合规。附常见问题修复和实战调试方法,大幅提升学术写作效率。

weixin_26833503的博客 374

Unity安卓原生交互android.content.res.Resources$NotFoundException: String resource问题

原生加载UnityActivatey的时候logcat人有如下错误提示: android.content.res.Resources$NotFoundException: String resource ID #0x0 解决方法: 把Unity导出AS工程中的 /XXX(工程名)/src/main/res/values/strings.xml文件的 <string name="game_v...

月儿圆 1862

蓝桥杯历年真题分类汇总(史上最全版本,一定不要错过)

天再高又怎样,踮起脚尖就更接近阳光。 满满的 题型总结​ 历年真题​ 视频讲解​ 比赛技巧 题型总结 2021 2020 2019 2018 2017 2016 2015 2014 2013 ...

m0_58367586的博客 11万+

android.content.res.Resources$NotFoundException: String resource ID #0xb

原代码: protected void convert(BaseViewHolder helper, Student item) { helper.setText(R.id.item_tv_realm_num,item.getNum()); helper.setText(R.id.item_tv_realm_name,item.getName()); helper.setText(R.id.item_tv_realm_age,item.getAge());

Think twice, code once. 748

MATLAB实现灰雁优化算法(GGO):从原理到实战的详细级教程

灰雁优化算法(GGO)是一种新型群体智能算法,模拟灰雁迁徙和觅食行为。算法通过领导更替机制、V形编队飞行和群体觅食策略,平衡全局探索与局部开发能力,具有收敛精度高、避免局部最优等特点。在MATLAB环境中,算法实现包括初始化种群、迭代更新领导雁、执行编队飞行和觅食行为等核心模块。用户可根据问题维度设置参数,通过收敛曲线和可视化分析评估性能。关键参数如领导更替频率、V形编队强度和觅食强度需根据问题复杂度调整,以获得最佳优化效果。该算法适用于各类优化问题,具有较好的鲁棒性和稳定性。

fx666_的博客 1212

Trae AI开发工具:大前端环境配置与避坑指南

大前端开发的第一步往往不是选框架,而是搭建一套可靠的工具链。IDE作为编码、调试与AI能力协同的载体,直接决定后续开发的顺畅度。传统编辑器需要手动拼装插件生态,而新一代AI开发工具将对话、代码生成与项目脚手架能力内置到编辑器底层,降低了环境准备的门槛。Trae基于VS Code内核,兼容其插件体系,同时提供Chat、Builder、内联对话三种AI交互模式,适合从VS Code迁移的开发者,也适合大前端新人快速上手。安装时需认准官方渠道,注意Node.js、Git版本联动,配置自动格式化与手动更新策略,并结

weixin_26833139的博客 281

android.content.res.Resources$NotFoundException错误处理

错误:android.content.res.Resources$NotFoundException: String resource ID # 原因:一般发生在参数 int resId 错误,你把String赋值给int的resId,所以编译器找不到正确的resource于是报错。 最简单的例子,检查一下你的Toast.makeText()啊textView.setText啊之类的函数,这种

Line 1936

小爱音箱Play增强版刷机接入大模型:自定义唤醒词与远程控制全攻略

智能音箱作为家庭语音入口,受限于厂商预设技能,难以满足个性化需求。通过串口刷机与Linux系统分区改造,可以完全掌控设备底层,将豆包、通义千问等大模型API接入原有音频链路,实现真正智能的语音问答。自定义唤醒词打破了“小爱同学”的唯一唤醒方式,结合ESP32-S3外挂模块,还能优化远场拾音。更深入的应用在于将音箱打造为家庭中控,通过大模型工具调用解析自然语言指令,实现远程控制电脑、智能灯等设备。本文从设备选型、拆机串口、系统备份到语音链路搭建,完整梳理了小爱音箱Play增强版的改造路径,适合具备动手能力的开

weixin_30036289的博客 713

[解决问题]android.content.res.Resources$NotFoundException

android.content.res.Resources$NotFoundException: String resource ID #0x1

洗棉花糖的浣熊的博客 1663

TI理想二极管在冗余电源中应用实例

深入探讨理想二极管如何提升冗余电源系统的效率与可靠性,通过实际应用案例展示其在电流隔离和自动切换中的优势,帮助工程师优化电源架构设计。

weixin_30653091的博客 989

SAP 系统间信任关系配置全攻略:从 SM59 到 SMT1 的实践与风险控制

本文介绍了在SAP系统间配置信任关系的详细流程与最佳实践。文章以SAP Gateway与后端系统架构为场景,从SM59创建RFC目的地开始,到SMT1建立信任关系,再到授权对象S_RFCACL的配置,提供了完整的操作指南。重点包括:使用标准命名规范创建专用RFC连接、通过向导完成系统间信任登记、严格控制S_RFCACL授权范围等。文中还分享了真实项目案例、可复用的检查清单以及常见问题的排查思路,帮助用户实现稳定可靠的跨系统无密码调用,同时确保安全性。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 323

android.content.res.Resources$NotFoundException

android.content.res.Resources$NotFoundException Resource ID #0x0 com.sh.sdk.shareinstall.helper.GetWebGLInfo.(GetWebGLInfo.java:42) 该异常表示找不到资源ID 。 [解决方案]:出现这个异常的原因有很多,具体原因可以参考Exception Message的内容,建议检查...

陈言必行 -- Unity游戏开发领域优质博主 3866

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

有关android.content.res.Resources$NotFoundException: String resource ID #0x14错误的解决方法

1、错误说明 今天在写一个项目的时候,LogCat报的是.Resources$NotFoundException: String resource ID #0x14。当时我还以为是因为我xml布局中的ID值和Java中的findViewById()不一致所造成的。跑过去检查了好久,都没有问题,后来在网上搜索,结果发现了问题。 2、问题解释:这个String resource ID #0x14是一个...

zy的博客 2068

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

解决:android.content.res.Resources$NotFoundException: String resource ID #0x0

注意字段所需数据类型

走马川行雪的博客 5739

深度学习工具包 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")

【解决】android.content.res.Resources$NotFoundException:String resource ID #0x86

运行中遇到这个异常,刚开始不知所措,因为异常出现在Toast的地方,原因最后发现是: 在Toast中的第二个参数是java.lang.CharSequence类型,而我在里面放进去的是int类型,忽略掉了,就出错了。 CharSequence是一个接口,不可以用new来实例化。 String 继承于CharSequence,也就是说String也是CharSequence类型。 CharS

xunfan的专栏 3117

关于Android中android.content.res.Resources$NotFoundException: String resource ID #0x9这类问题的解决

在Android的TextView.setText(a)中输入内容时遇到一个问题如下所示:   E/AndroidRuntime(14850): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.alarm/com.my.alarm.AlarmTest}: android.content.res.

Ada168855的专栏 3752

android.content.res.Resources$NotFoundException: String resource ID #0xc8报错解决

android.content.res.Resources$NotFoundException: String resource ID #0xc8 Android程序报这个错 标示没有找到该资源 有可能是在setText等等操作时设置了一个int ... 的类型的参数 然而 比如Toas.makeText()你传入一个int型的参数 就会导致Android 系统去 按照这个int 去寻找以

qq_34953641的博客 852

android.content.res.Resources$NotFoundException: String resource ID #0x3 [已解决]

TextView中setText的时候,放了int类型的数据,用String.ValueOf()即可。

wellorbetter的博客 370

android.content.res.Resources$NotFoundException: String resource ID #0x0的解决

今天跑程序的时候,出现这样的错误: android.content.res.Resources$NotFoundException:String resource ID #0x86LogCat显示出错行是: main_message_count.setText(app.newMessage.size());开始的时候,死活找不出原因。 后来发现错误原因是: bet.ge

pengyu1801的专栏 546

android.content.res.Resources$NotFoundException: String resource ID #0x640错误解决方法

android.content.res.Resources$NotFoundException: String resource ID #0x640错误解决方法

weixin_62393327的博客 701

android.content.res.Resources$NotFoundException: String resource ID #0x1解决方案

Android Studio爆红: android.content.res.Resources$NotFoundException: String resource ID #0x1 这是由于DataBinding进行双向绑定时只允许String类型,当要传入Int类型时需要进行转换代码如下: 这个问题在setText时传值也会经常遇到,要传String类型的数据...

java521666的博客 850

android.content.res.Resources$NotFoundException: String resource ID #0x6错误的解决办法

在开发过程当中遇到这个问题 08-17 18:12:24.835: E/AndroidRuntime(17951): FATAL EXCEPTION: main 08-17 18:12:24.835: E/AndroidRuntime(17951): android.content.res.Resources$NotFoundException: String resource ID #0x

Snowball 4272

android.content.res.Resources$NotFoundException: String resource ID #0x4bc6解决方法

TextView.setText(int)会导致出现该错误,只需要将int类型转换为String类型即可,TextView.setText(String.valueOf(int)) 有疑问的可以下方留言,相互学习,我是心哥说编程,致力于成为一个编程大牛编程爱好者。 ...

Trybravely的博客 1866

android.content.res.Resources$NotFoundException: String resource ID #0x3问题 解决

原因分析:资源找不到异常 1.控件找不到 2.对应设置的值为int,被系统误认为是id导致找不到 参考链接 https://blog.csdn.net/ludlee/article/details/79665674

qq_34024778的博客 513

android.content.res.Resources$NotFoundException: String resource ID #0x1 原因及解决方案

安卓开发中,有时会遇到这个问题,我这次就是在Toast里输出一个数字造成的,这是因为有时会会在需要输入字符串的位置输入了一个数字,编译器不会提示错误,但是运行时就会出现这个错误了。 我的错误代码: int a = 5; Toast.makeText(MainActivity.this,a,Toast.LENGTH_SHORT).show(); 修改就很简单了 int a = 5; To...

吟游诗人——吟唱生命的不朽 1095

Android报Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 .解决办法

如果遇到这个问题,首先考虑以下原因: 你是否在setText()方法中设置了一个int型变量,比如setText(10)。 这样Android系统就会主动去资源文件当中寻找, 但是它不是一个资源文件ID, 所以就会报出这个bug。  解决办法:将int型业务数据,转换成String类型即可,比如setText(10+“”);

zhouzhiwengang的专栏 2508
上一篇: android 如果增加应用的内存
下一篇: fastjson对Date的处理
千雅爸爸
博客等级 码龄18年 292粉丝 639原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值