wangweifrank / android-binding

Automatically exported from code.google.com/p/android-binding
0 stars 0 forks source link

NPE on binding model to layout v.45 stable version #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Folks!

Sometimes when i call "setAndBindContentView" in onCreate of an activity i get 
the following Exception.

Caused by: java.lang.NullPointerException
at gueei.binding.Observable.notifyChanged(Observable.java:52)
at gueei.binding.Observable.set(Observable.java:71)
at gueei.binding.Observable._setObject(Observable.java:79)
at 
gueei.binding.TwoWayDependentObservable.doSetValue(TwoWayDependentObservable.jav
a:25)
at gueei.binding.Observable.set(Observable.java:69)
at gueei.binding.Observable._setObject(Observable.java:79)
at gueei.binding.Attribute$Bridge.onPropertyChanged(Attribute.java:117)
at gueei.binding.Observable.notifyChanged(Observable.java:52)
at gueei.binding.Observable.notifyChanged(Observable.java:61)
at 
gueei.binding.viewAttributes.compoundButton.CheckedViewAttribute.onCheckedChange
d(CheckedViewAttribute.java:44)
at 
gueei.binding.listeners.OnCheckedChangeListenerMulticast.onCheckedChanged(OnChec
kedChangeListenerMulticast.java:20)
at android.widget.CompoundButton.setChecked(CompoundButton.java:124)
at 
gueei.binding.viewAttributes.compoundButton.CheckedViewAttribute.doSetAttributeV
alue(CheckedViewAttribute.java:34)
at gueei.binding.Attribute._setObject(Attribute.java:55)
at gueei.binding.Attribute.onBind(Attribute.java:85)
at gueei.binding.Attribute.BindTo(Attribute.java:70)
at 
gueei.binding.AttributeBinder.bindAttributeWithObservable(AttributeBinder.java:7
4)
at gueei.binding.AttributeBinder.bindView(AttributeBinder.java:57)
at gueei.binding.Binder.setAndBindContentView(Binder.java:116)

I'm not sure where this NPE comes from. Anyone knows?

Best Regards!

Stephan

Original issue reported on code.google.com by stephan....@runtastic.com on 16 Jan 2012 at 10:16

GoogleCodeExporter commented 8 years ago
If possible please submit your respective View Model, Activity and XML (to 
Discussion Group). It looks like one of the dependents is released by GC in an 
unexpected way. I am not quite sure it is coming from the problem of the 
WeakList implementation or Observable so your code is valuable to us. Thanks

Original comment by gueei....@gmail.com on 1 Feb 2012 at 12:25