<?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 problem with getGraphicIDs() in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/problem-with-getgraphicids/m-p/46242#M378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having some problem when it comes to using the method getGraphicIDs for graphic layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a single tap function that is called when the map is pressed. It will create one circular point graphic on the map for the first 3 taps, and subsequently, the method getGraphicIDs is used to determine whether I have clicked on one of the graphics created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, this method works well if i click on the graphics created, but once i click somewhere else on the map where there is no graphics, my program closes and exits unexpectedly. Is there any issue with this? Please help!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is my code snippets:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;public boolean onSingleTap(MotionEvent e){

float x = e.getX();
float y = e.getY();
Point screenPoint = new Point(x,y);
Point mapPoint = map.toMapPoint(screenPoint);

if (graphicsLayer.getNumberOfGraphics() &amp;lt;=3){
 
&amp;nbsp; Graphic graphic = new Graphic(mapPoint,new SimpleMarkerSimbol(Color.BLUE,25,Style.CIRCLE));
&amp;nbsp; graphicsLayer.addGraphic(graphic);
 }
 else{
&amp;nbsp; int[] ids = graphicsLayer.getGraphicIDs(x,y,7);
&amp;nbsp; if(ids != null){
&amp;nbsp; Toast toast1 = Toast.makeText(project.this,"Graphic selected", Toast.LENGTH_SHORT);
&amp;nbsp; toast1.show;
&amp;nbsp; }
&amp;nbsp; else{
&amp;nbsp; Toast toast2 = Toast.makeText(project.this,"No graphic selected", Toast.LENGTH_SHORT);
&amp;nbsp; toast2.show;
&amp;nbsp; }
 }
return true;
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2013 01:10:04 GMT</pubDate>
    <dc:creator>KarinNeo</dc:creator>
    <dc:date>2013-06-13T01:10:04Z</dc:date>
    <item>
      <title>problem with getGraphicIDs()</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/problem-with-getgraphicids/m-p/46242#M378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having some problem when it comes to using the method getGraphicIDs for graphic layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a single tap function that is called when the map is pressed. It will create one circular point graphic on the map for the first 3 taps, and subsequently, the method getGraphicIDs is used to determine whether I have clicked on one of the graphics created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, this method works well if i click on the graphics created, but once i click somewhere else on the map where there is no graphics, my program closes and exits unexpectedly. Is there any issue with this? Please help!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is my code snippets:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;public boolean onSingleTap(MotionEvent e){

float x = e.getX();
float y = e.getY();
Point screenPoint = new Point(x,y);
Point mapPoint = map.toMapPoint(screenPoint);

if (graphicsLayer.getNumberOfGraphics() &amp;lt;=3){
 
&amp;nbsp; Graphic graphic = new Graphic(mapPoint,new SimpleMarkerSimbol(Color.BLUE,25,Style.CIRCLE));
&amp;nbsp; graphicsLayer.addGraphic(graphic);
 }
 else{
&amp;nbsp; int[] ids = graphicsLayer.getGraphicIDs(x,y,7);
&amp;nbsp; if(ids != null){
&amp;nbsp; Toast toast1 = Toast.makeText(project.this,"Graphic selected", Toast.LENGTH_SHORT);
&amp;nbsp; toast1.show;
&amp;nbsp; }
&amp;nbsp; else{
&amp;nbsp; Toast toast2 = Toast.makeText(project.this,"No graphic selected", Toast.LENGTH_SHORT);
&amp;nbsp; toast2.show;
&amp;nbsp; }
 }
return true;
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 01:10:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/problem-with-getgraphicids/m-p/46242#M378</guid>
      <dc:creator>KarinNeo</dc:creator>
      <dc:date>2013-06-13T01:10:04Z</dc:date>
    </item>
  </channel>
</rss>

