AnsweredAssumed Answered

Callout causes NullPointerException in onMeasure

Question asked by bastischo on Mar 10, 2016

Hello we are using the ArcGIS Runtime SDK for Android for our App.

We get large amounts of Crash reports that look like this (see below).

 

Can anybody help with this, since our own code does not seem to be involved in there?

 

This is an example of how we use the Callout:

View v = LayoutInflater.from(mThis).inflate(R.layout.callout_to_task, null);

TextView nameTextView = (TextView) v.findViewById(R.id.job_name_text);

setShortenedJobName(task.getDescription(), nameTextView);

((TextView) v.findViewById(R.id.job_value_text)).setText(task.getRewardFormatted());

v.setOnClickListener(mMessageDetailsListener);

 

mCallout.setContent(v);

mCallout.setStyle(R.xml.callout_style);

mCallout.setOffset(0, mCalloutYOffset);

mCallout.show(task.getLocation().toMapPoint(mMap));

 

And  this is the corresponding xml file:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:orientation="vertical">

 

  <TextView
   android:id="@+id/job_name_text"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="Prüfe VerkehrsRichtung"
   android:textColor="@color/AppJobberGreen" />

 

  <TextView
   android:id="@+id/job_value_text"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_below="@id/job_name_text"
   android:layout_alignRight="@+id/job_name_text"
   android:layout_alignEnd="@+id/job_name_text"
   android:text="0,00€"
   android:textStyle="bold" />

</RelativeLayout>

 

java.lang.NullPointerException

at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:548)

at android.view.View.measure(View.java:16030)

at com.esri.android.map.Callout$a.c(SourceFile:997)

at com.esri.android.map.Callout$a.onMeasure(SourceFile:914)

at android.view.View.measure(View.java:16030)

at android.view.ViewGroup.measureChild(ViewGroup.java:4983)

at com.esri.android.map.MapView.onMeasure(SourceFile:1357)

at android.view.View.measure(View.java:16030)

at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:728)

at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)

at android.view.View.measure(View.java:16030)

at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:728)

at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)

at android.view.View.measure(View.java:16030)

at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)

at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)

at android.view.View.measure(View.java:16030)

at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5012)

at android.widget.FrameLayout.onMeasure(FrameLayout.java:314)

at android.view.View.measure(View.java:16030)

at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:848)

at android.view.View.measure(View.java:16030)

at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5012)

at android.widget.FrameLayout.onMeasure(FrameLayout.java:314)

at android.view.View.measure(View.java:16030)

at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5012)

at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:302)

at android.view.View.measure(View.java:16030)

at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5012)

at android.widget.FrameLayout.onMeasure(FrameLayout.java:314)

at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2196)

at android.view.View.measure(View.java:16030)

at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1906)

at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1105)

at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1285)

at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1005)

at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5498)

at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)

at android.view.Choreographer.doCallbacks(Choreographer.java:562)

at android.view.Choreographer.doFrame(Choreographer.java:532)

at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)

at android.os.Handler.handleCallback(Handler.java:730)

at android.os.Handler.dispatchMessage(Handler.java:92)

at android.os.Looper.loop(Looper.java:137)

at android.app.ActivityThread.main(ActivityThread.java:5232)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:525)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)

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

at dalvik.system.NativeStart.main(Native Method)

Outcomes