<?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 ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79129#M582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently using the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;ExportTileCacheTask &lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;to export a tpk file from&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"&gt;http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Following the sample: &lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/export-tiles" title="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/export-tiles"&gt;arcgis-runtime-samples-android/export-tiles at master · Esri/arcgis-runtime-samples-android · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, it crashes with exception &lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The exception is thrown on the line similar to line 211 of the sample&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;SPAN class=""&gt;ExportTileCacheParameters&lt;/SPAN&gt; parameters &lt;SPAN class=""&gt;=&lt;/SPAN&gt; parametersFuture&lt;SPAN class=""&gt;.&lt;/SPAN&gt;get();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Here's the full exception log:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;10-09 15:50:40.182 12160-12160/package W/System.err: java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.esri.arcgisruntime.internal.a.b.get(SourceFile:128)&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at de.maengelmelder.mainmodule.activities.MapCachingActivity$doRetrieveMapCache$1.run(MapCachingActivity.kt:184)&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.os.Handler.handleCallback(Handler.java:739)&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.os.Handler.dispatchMessage(Handler.java:95)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.os.Looper.loop(Looper.java:145)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.app.ActivityThread.main(ActivityThread.java:5951)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.reflect.Method.invoke(Native Method)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.reflect.Method.invoke(Method.java:372)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err: Caused by: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.esri.arcgisruntime.internal.a.b.get(SourceFile:120)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err: &amp;nbsp;&amp;nbsp; &amp;nbsp;... 9 more&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's no more indication of the error or the cause of it.&lt;/P&gt;&lt;P&gt;Any possible cause or solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks before,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Oct 2017 13:54:12 GMT</pubDate>
    <dc:creator>JasonChristian</dc:creator>
    <dc:date>2017-10-09T13:54:12Z</dc:date>
    <item>
      <title>ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79129#M582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently using the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;ExportTileCacheTask &lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;to export a tpk file from&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"&gt;http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Following the sample: &lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/export-tiles" title="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/export-tiles"&gt;arcgis-runtime-samples-android/export-tiles at master · Esri/arcgis-runtime-samples-android · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, it crashes with exception &lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The exception is thrown on the line similar to line 211 of the sample&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;SPAN class=""&gt;ExportTileCacheParameters&lt;/SPAN&gt; parameters &lt;SPAN class=""&gt;=&lt;/SPAN&gt; parametersFuture&lt;SPAN class=""&gt;.&lt;/SPAN&gt;get();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Here's the full exception log:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;10-09 15:50:40.182 12160-12160/package W/System.err: java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.esri.arcgisruntime.internal.a.b.get(SourceFile:128)&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at de.maengelmelder.mainmodule.activities.MapCachingActivity$doRetrieveMapCache$1.run(MapCachingActivity.kt:184)&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.os.Handler.handleCallback(Handler.java:739)&lt;BR /&gt;10-09 15:50:40.182 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.os.Handler.dispatchMessage(Handler.java:95)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.os.Looper.loop(Looper.java:145)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at android.app.ActivityThread.main(ActivityThread.java:5951)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.reflect.Method.invoke(Native Method)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.reflect.Method.invoke(Method.java:372)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err: Caused by: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at com.esri.arcgisruntime.internal.a.b.get(SourceFile:120)&lt;BR /&gt;10-09 15:50:40.192 12160-12160/package W/System.err: &amp;nbsp;&amp;nbsp; &amp;nbsp;... 9 more&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's no more indication of the error or the cause of it.&lt;/P&gt;&lt;P&gt;Any possible cause or solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks before,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 13:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79129#M582</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2017-10-09T13:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79130#M583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On your ExportTileCacheTask, did you call loadAsync prior to calling get()?&amp;nbsp; I would also place the get in the DoneLoadingListener section as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 14:18:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79130#M583</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-10-09T14:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79131#M584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thank you for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem still persists. I have added the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;exportTask.loadAsync()&lt;/SPAN&gt; &lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;after adding &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;exportTask.addDoneLoadingListener() &lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;and it's still showing the same error on the get() method. Here's the overview of my code (in Kotlin):&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;val env = viewToExtent() // Similar to the sample
val minScale = 10000.0 // 1 : 10000
val maxScale = 1000.0 // 1 : 1000
val url = "http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"

val exportTask = ExportTileCacheTask(url)
exportTask.addDoneLoadingListener{
&amp;nbsp;&amp;nbsp; val future = exportTask.createDefaultExportTileCacheParametersAsync(env, minScale, maxScale)
&amp;nbsp;&amp;nbsp; future.addDoneListener {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val params = future.get() // ArcGISRunTimeException: Cannot call this method..
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}
exportTask.loadAsync()

&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;EDIT: I noticed that there's a &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;setCredential()&lt;/SPAN&gt; method from the &lt;/SPAN&gt;ExportTileCacheTask&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;. 
I have not used that (and the sample uses sampleserver rather than actual ArcGIS service). Might that be the problem?
&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;EDIT 2: Tried adding &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;UserCredential(username, password)&lt;/SPAN&gt; to the &lt;/SPAN&gt;ExportTileCacheTask.setCredential(). &lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Still the same problem&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:03:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79131#M584</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2021-12-10T23:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79132#M585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I imagine using the sample server might be part of the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not think this is equipped to handle that type of call as it would need an export tiles call on the service.&amp;nbsp; I know this service is equipped to handle the request:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="unlinked"&gt;https://tiledbasemaps.arcgis.com/arcgis/rest/services/World_Topo_Map/MapServer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:19:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79132#M585</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-10-10T13:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79133#M586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. It works with this URL and the credential supplied. I didn't realize the ArcGIS online service does not have exportTiles method&lt;/P&gt;&lt;P&gt;Perhaps the developers for runtime SDK can make more meaningful error message than &lt;EM&gt;"java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For others who faced the same problem, here's the snippet in Kotlin&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;val env = viewToExtent() // Similar to the sample
val minScale = 10000.0 // 1 : 10000
val maxScale = 1000.0 // 1 : 1000. Make sure maxScale &amp;lt; minScale
val filepath = "sdcard/mymap/test.tpk" // Path to your map file. Make sure the directories are already created
val url = "&lt;A&gt;https://tiledbasemaps.arcgis.com/arcgis/rest/services/World_Topo_Map/MapServer/&lt;/A&gt;"

val exportTask = ExportTileCacheTask(url)
// Set the credentials, because the tiledbasemap service requires auth
exportTask.setCredential(UserCredential("&amp;lt;your-username&amp;gt;", "&amp;lt;your-password&amp;gt;"))
exportTask.addDoneLoadingListener{
&amp;nbsp;&amp;nbsp; val future = exportTask.createDefaultExportTileCacheParametersAsync(env, minScale, maxScale)
&amp;nbsp;&amp;nbsp; future.addDoneListener {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get parameter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val params = future.get()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create export job with the given param and filepath. The actual download and export happen here
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val exportJob = exportTask.exportTileCacheAsync(params, filepath)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // If you care about the status of your job
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportJob.addJobChangedListener { Log.i("INFO", "jobInfo: ${exportJob.messages.last().message}") }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // When the job is done&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportJob.addJobDoneListener { 
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; val result = job.result
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result != null) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Success. The tpk file is saved to the supplied file path. The result contains the info about the TPK file
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Failed. Perhaps due to the above error, or the tpk size is too big (Dunno the exact limit)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Start the job
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportJob.start()
&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}

exportTask.loadAsync()

&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Also, another bit of a problem. I noticed that the Envelope class is not serialized (or is it?).&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;So, is it not possible to pass the Envelope inside an Intent, to be sent to a Service / another Activity?
&lt;/SPAN&gt;
&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Thanks again for the quick response,
Jason&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:03:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79133#M586</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2021-12-10T23:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79134#M587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a toJson() and fromJson() method so you can construct it from a &lt;A href="https://developer.android.com/reference/android/os/Parcelable.html"&gt;Parcelable&lt;/A&gt; or even put it into the &lt;A href="https://developer.android.com/reference/android/content/Intent.html#putExtra(java.lang.String, java.lang.CharSequence)"&gt;Intent extras&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79134#M587</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-10-10T14:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79135#M588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah very nice. Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:10:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79135#M588</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2017-10-10T14:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISRuntimeException: Cannot call this method in this context when doing exportTile from Android</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79136#M589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem.&amp;nbsp; Happy to help.&amp;nbsp; I will forward the suggestion about descriptive error messages internally and hopefully we will see some positive results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:14:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/arcgisruntimeexception-cannot-call-this-method-in/m-p/79136#M589</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-10-10T14:14:58Z</dc:date>
    </item>
  </channel>
</rss>

