Android Question [Solved] Widget NullPointerException at ConfigureHomeWidget(...)

fredo

Well-Known Member
Licensed User
Longtime User
While working with Erel's tutorial I and II I might haved missed it but it is important to respect the special case how views are handled in Widgets.

At some point experimenting I came across this error:
B4X:
~e:starter_service_create (java line: 165)
~e:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
~e:    at anywheresoftware.b4a.objects.RemoteViewsWrapper.loadLayoutHelper(RemoteViewsWrapper.java:71)
~e:    at anywheresoftware.b4a.objects.RemoteViewsWrapper.loadLayoutHelper(RemoteViewsWrapper.java:77)
~e:    at anywheresoftware.b4a.objects.RemoteViewsWrapper.loadLayoutHelper(RemoteViewsWrapper.java:77)
~e:    at anywheresoftware.b4a.objects.RemoteViewsWrapper.createRemoteViews(RemoteViewsWrapper.java:58)
~e:    at b4a.example2.starter._service_create(starter.java:165)
~e:    at java.lang.reflect.Method.invoke(Native Method)
~e:    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
~e:    at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)


It took me a while to crawl to the cause and found it here:
22-12-_2017_16-41-48.jpg

So in this case it was using the text property at design time which should stay empty.

I thought it might help someone who searches the forum for a hint.
 
Top