<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Facing ANR when get identify graphic overlay in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/facing-anr-when-get-identify-graphic-overlay/m-p/1256386#M5961</link>
    <description>&lt;P&gt;Really thanks Hudson_Miears, I was thinking about the Future task which will be the cause of ANR and intended to move it into the background. But with your solution, I just need to use existing function.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2023 02:32:54 GMT</pubDate>
    <dc:creator>MinhPham92</dc:creator>
    <dc:date>2023-02-09T02:32:54Z</dc:date>
    <item>
      <title>Facing ANR when get identify graphic overlay</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/facing-anr-when-get-identify-graphic-overlay/m-p/1256046#M5959</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am facing some ANR with my implement as below and the log for ANR point to our Arcgis map when getting the identify graphic overlay.&lt;BR /&gt;Could someone help to check for that?&lt;BR /&gt;Please let me know if you need further information&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Implementation for touching listener:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;onTouchListener &lt;/SPAN&gt;=&lt;BR /&gt;    &lt;SPAN&gt;object &lt;/SPAN&gt;: DefaultMapViewOnTouchListener(context, &lt;SPAN&gt;this&lt;/SPAN&gt;) {&lt;BR /&gt;        &lt;SPAN&gt;override fun &lt;/SPAN&gt;onSingleTapConfirmed(event: MotionEvent): Boolean {&lt;BR /&gt;            &lt;SPAN&gt;val &lt;/SPAN&gt;screenPoint =&lt;BR /&gt;                android.graphics.Point(event.&lt;SPAN&gt;x&lt;/SPAN&gt;.&lt;SPAN&gt;roundToInt&lt;/SPAN&gt;(), event.&lt;SPAN&gt;y&lt;/SPAN&gt;.&lt;SPAN&gt;roundToInt&lt;/SPAN&gt;())&lt;BR /&gt;            &lt;SPAN&gt;val &lt;/SPAN&gt;identifyGraphic = &lt;SPAN&gt;mMapView&lt;/SPAN&gt;.identifyGraphicsOverlayAsync(&lt;BR /&gt;                graphicsOverlay,&lt;BR /&gt;                screenPoint,&lt;BR /&gt;                &lt;SPAN&gt;10.0&lt;/SPAN&gt;,&lt;BR /&gt;                &lt;SPAN&gt;false&lt;/SPAN&gt;,&lt;BR /&gt;                Int.&lt;SPAN&gt;MAX_VALUE&lt;BR /&gt;&lt;/SPAN&gt;            )&lt;BR /&gt;&lt;BR /&gt;            &lt;SPAN&gt;try &lt;/SPAN&gt;{&lt;BR /&gt;                &lt;SPAN&gt;val &lt;/SPAN&gt;identifyGraphicsOverlayResult = identifyGraphic.get()&lt;BR /&gt;                &lt;SPAN&gt;val &lt;/SPAN&gt;graphics = identifyGraphicsOverlayResult.&lt;SPAN&gt;graphics&lt;BR /&gt;            } catch(e: Exception){&lt;BR /&gt;                // print log here&lt;BR /&gt;            }&lt;BR /&gt;      return super.onSingleTapConfirmed(event)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;ANR log report:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;libc.so&lt;BR /&gt;syscall + &lt;SPAN&gt;28&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;. libc.so&lt;BR /&gt;__futex_wait_ex(void volatile*, bool, int, bool, timespec &lt;SPAN&gt;const&lt;/SPAN&gt;*) + &lt;SPAN&gt;144&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;. libc.so &lt;BR /&gt;pthread_cond_wait + &lt;SPAN&gt;76&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;std::__ndk1::condition_variable::wait(std::__ndk1::unique_lock&amp;lt;std::__ndk1::mutex&amp;gt;&amp;amp;) + &lt;SPAN&gt;20&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;(Missing BuildId &lt;SPAN&gt;4&lt;/SPAN&gt;d4a58df2fe1ee0c204b45b49389f1966c646580)&lt;BR /&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;(Missing BuildId &lt;SPAN&gt;4&lt;/SPAN&gt;d4a58df2fe1ee0c204b45b49389f1966c646580)&lt;BR /&gt;&lt;SPAN&gt;6&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;(Missing BuildId &lt;SPAN&gt;4&lt;/SPAN&gt;d4a58df2fe1ee0c204b45b49389f1966c646580)&lt;BR /&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;(Missing BuildId &lt;SPAN&gt;4&lt;/SPAN&gt;d4a58df2fe1ee0c204b45b49389f1966c646580)&lt;BR /&gt;&lt;SPAN&gt;8&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;(Missing BuildId &lt;SPAN&gt;4&lt;/SPAN&gt;d4a58df2fe1ee0c204b45b49389f1966c646580)&lt;BR /&gt;&lt;SPAN&gt;9&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;(Missing BuildId &lt;SPAN&gt;4&lt;/SPAN&gt;d4a58df2fe1ee0c204b45b49389f1966c646580)&lt;BR /&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;RT_Task_get + &lt;SPAN&gt;32&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;11&lt;/SPAN&gt;. split_config.arm64_v8a.apk&lt;BR /&gt;Java_com_esri_arcgisruntime_internal_jni_CoreTask_nativeGet + &lt;SPAN&gt;20&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;com.esri.arcgisruntime.&lt;SPAN&gt;internal&lt;/SPAN&gt;.jni.CoreTask.nativeGet (SourceFile)&lt;BR /&gt;&lt;BR /&gt;com.esri.arcgisruntime.&lt;SPAN&gt;internal&lt;/SPAN&gt;.jni.CoreTask.f (SourceFile:&lt;SPAN&gt;1&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;com.esri.arcgisruntime.&lt;SPAN&gt;internal&lt;/SPAN&gt;.concurrent.b.get (SourceFile:&lt;SPAN&gt;23&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;.......setOnMapViewTouchListener$&lt;SPAN&gt;1&lt;/SPAN&gt;.onSingleTapConfirmed&lt;/PRE&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 09:12:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/facing-anr-when-get-identify-graphic-overlay/m-p/1256046#M5959</guid>
      <dc:creator>MinhPham92</dc:creator>
      <dc:date>2023-02-08T09:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Facing ANR when get identify graphic overlay</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/facing-anr-when-get-identify-graphic-overlay/m-p/1256101#M5960</link>
      <description>&lt;P&gt;Hello! It looks like the ANR is most likely caused by this line:&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val identifyGraphicsOverlayResult = identifyGraphic.get()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;ListenableFuture.get() will block the current thread until the result is available. In 100.15 and previous versions of the SDK, we recommend you use a callback pattern instead:&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val screenPoint = android.graphics.Point(event.x.roundToInt(), event.y.roundToInt())
val identifyGraphicsOverlayResultFuture = mMapView.identifyGraphicsOverlayAsync(
  graphicsOverlay,
  screenPoint,
  10.0,
  false,
  Int.MAX_VALUE
)

identifyGraphicsOverlayResultFuture.addDoneListener {
  try {
    val identifyGraphicsOverlayResult = identifyGraphicsOverlayResultFuture.get()
    val graphics = identifyGraphicsOverlayResult.graphics
  } catch(e: Exception){
    // print log here
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;For more information, you could check out &lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/blob/9d87df7447a5a3303eaad07bb0a06128b4fdd5c7/kotlin/identify-layers/src/main/java/com/esri/arcgisruntime/sample/identifylayers/MainActivity.kt#L113" target="_blank" rel="noopener"&gt;this sample&lt;/A&gt;. It doesn't use MapView.identifyGraphicsOverlayAsync(), but it does use the same pattern.&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 14:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/facing-anr-when-get-identify-graphic-overlay/m-p/1256101#M5960</guid>
      <dc:creator>Hudson_Miears</dc:creator>
      <dc:date>2023-02-08T14:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Facing ANR when get identify graphic overlay</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/facing-anr-when-get-identify-graphic-overlay/m-p/1256386#M5961</link>
      <description>&lt;P&gt;Really thanks Hudson_Miears, I was thinking about the Future task which will be the cause of ANR and intended to move it into the background. But with your solution, I just need to use existing function.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 02:32:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/facing-anr-when-get-identify-graphic-overlay/m-p/1256386#M5961</guid>
      <dc:creator>MinhPham92</dc:creator>
      <dc:date>2023-02-09T02:32:54Z</dc:date>
    </item>
  </channel>
</rss>

