<?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 Want to show a ProgressDialog while loading the MapView in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/want-to-show-a-progressdialog-while-loading-the/m-p/99497#M742</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's the situation: my app loads 1 MapView. Loading this view will take some time, of course. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want a ProgressDialog to be shown during this loading time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The proper way to this is by using an AsyncTask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However: creating a new MapView object inside of the doInBackground method is not allowed: it's not allowed to interact with the UI inside this method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have a suggestion? Is there a way to do this? Could not find this through Google nor on this forum.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2013 13:51:49 GMT</pubDate>
    <dc:creator>LeonardSimonse</dc:creator>
    <dc:date>2013-09-12T13:51:49Z</dc:date>
    <item>
      <title>Want to show a ProgressDialog while loading the MapView</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/want-to-show-a-progressdialog-while-loading-the/m-p/99497#M742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's the situation: my app loads 1 MapView. Loading this view will take some time, of course. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want a ProgressDialog to be shown during this loading time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The proper way to this is by using an AsyncTask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However: creating a new MapView object inside of the doInBackground method is not allowed: it's not allowed to interact with the UI inside this method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have a suggestion? Is there a way to do this? Could not find this through Google nor on this forum.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 13:51:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/want-to-show-a-progressdialog-while-loading-the/m-p/99497#M742</guid>
      <dc:creator>LeonardSimonse</dc:creator>
      <dc:date>2013-09-12T13:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Want to show a ProgressDialog while loading the MapView</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/want-to-show-a-progressdialog-while-loading-the/m-p/99498#M743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One option is to include a Layout with a ProgressBar that is already visible when the map is launched, and then set an OnStatusChangedListener on the MapView to hide that Layout when the map is initialized.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mapView.setOnStatusChangedListener(new OnStatusChangedListener() {&amp;nbsp; public void onStatusChanged(Object sender, STATUS status) { &amp;nbsp; if (status.equals(STATUS.INITIALIZED)) { &amp;nbsp;&amp;nbsp; findViewById(R.id.relativeLayoutLoading).setVisibility(View.GONE); &amp;nbsp; }&amp;nbsp; } });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On a side note, while I haven't actually tried it, I think you should be able to manipulate the MapView from a background thread by using runOnUiThread().&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;MyActivity.this.runOnUiThread(new Runnable() {&amp;nbsp; public void run() { &amp;nbsp; // do something&amp;nbsp; } });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 14:50:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/want-to-show-a-progressdialog-while-loading-the/m-p/99498#M743</guid>
      <dc:creator>JasonKnisley</dc:creator>
      <dc:date>2013-09-12T14:50:19Z</dc:date>
    </item>
  </channel>
</rss>

