Firebase空指针异常(Firebase null pointer exception)
我在firebase中得到空指针异常我知道没有任何值,就像我给出的数据库引用那样但是我希望当生成该值时它会自动显示...只是想得到那个单值每次它在firebase上创建但它在行上给我空指针异常String val = .....
请帮帮我 ...
final DatabaseReference dtt = database.getReference("/trial/trials/"); dtt.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { String val= dataSnapshot.child("myvalue").getValue().toString(); if(val!=null) { Log.e("not null------","---------------"); }else { Log.e("null------","---------------"); } } @Override public void onCancelled(DatabaseError databaseError) { } });
请帮帮我......请..
I am getting null pointer exception in firebase I knows that there is not any value like that to which database reference I am giving but I wants that when the value is generated then it will be shown automatically... Just wants to get that single value everytime it is created on the firebase but its giving me null pointer exception on the line String val =.....
Please help me ...
final DatabaseReference dtt = database.getReference("/trial/trials/"); dtt.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { String val= dataSnapshot.child("myvalue").getValue().toString(); if(val!=null) { Log.e("not null------","---------------"); }else { Log.e("null------","---------------"); } } @Override public void onCancelled(DatabaseError databaseError) { } });
Please help me.....Please ..
原文:https://stackoverflow.com/questions/38186051
满意答案
我传统上做的是使用一个自定义的IUserType类,它将在有问题的枚举和如何持久化之间进行转换。 但是,这需要每个枚举类型的自定义IUserType。
What I've traditionally done is use a custom IUserType class that would translate between the enum in question and how it would be persisted. However, this required a custom IUserType per enum type.
相关问答
更多流利的nHibernate Automapping不创建复数表名(Fluent nHibernate Automapping not creating Plural table name)
当尝试提交列表<>时,Fluent NHibernate AutoMapping会抛出“StaleStateException”(Fluent NHibernate AutoMapping throws “StaleStateException” when try to Commit a List<>)
流利的NHibernate DuplicateMappingException与AutoMapping(Fluent NHibernate DuplicateMappingException with AutoMapping)
使用流畅的Nhibernate Automapping和Guids / UniqueIdentifier作为主键字段的问题(Issue With Fluent Nhibernate Automapping and Guids / UniqueIdentifiers as Primary Key Fields)
流畅的NHibernate AutoMapping SchemaExport - 更改对象模型和保持数据(Fluent NHibernate AutoMapping SchemaExport - Change object model and Keeping Data)
如何在不自动化的情况下告诉Fluent NHibernate忽略特定属性?(How do I tell Fluent NHibernate to ignore specific properties without automapping?)
流利NHibernate的自动映射:改变日期时间到时间戳(Fluent NHibernate Automapping: Alter DateTime to Timestamp)
流畅的nHibernate与Automapping:如何在关系的“Child”侧设置Inverse(Fluent nHibernate with Automapping: How to set Inverse on “Child” side of relation)
流畅的NHibernate自动化问题与2类重新同一类(Fluent NHibernate automapping problem with 2 class refrencing same class)
将EnumTypes与Fluent NHibernate和Automapping一起使用(Using EnumTypes with Fluent NHibernate and Automapping)
相关文章
更多java Exception异常处理实例
EXT4 Store Load For Gird Exception
EXT4 Store Batch Sync Exception
Guava学习笔记:Optional优雅的使用null
Hive 终端产生的问题 (Failed to start database 'metastore_db', see the next exception for details.)
[Hadoop Err] Call to ? failed on local exception: java.net.NoRouteToHostException: No route to host
为什么执行JAVA程序时,会出现Exception in thread"main" java.lan
Java基础:异常的限制
Java 异常处理
List用完后需要赋null吗
最新问答
更多您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
在计算机拍照在哪里进入
使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
单页应用程序:页面重新加载(Single Page Application: page reload)
在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!