Skip to content

Commit 6b26187

Browse files
committed
PR feedback
1 parent 19381d7 commit 6b26187

File tree

3 files changed

+8
-9
lines changed
  • add-feature-layers/src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers
  • display-map-from-mobile-map-package/src/main/java/com/esri/arcgisruntime/sample/displaymapfrommobilemappackage
  • samples-lib/src/main/java/com/esri/arcgisruntime/sample/sampleslib

3 files changed

+8
-9
lines changed

add-feature-layers/src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers/DownloadActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class DownloadActivity : DownloaderActivity() {
1010
super.onCreate(savedInstanceState)
1111
downloadAndStartSample(
1212
Intent(this, MainActivity::class.java),
13-
// get the download path of the sample
14-
downloadFolder(getString(R.string.app_name)),
13+
// get the app name of the sample
14+
getString(R.string.app_name),
1515
listOf(
1616
// ArcGIS Portal item containing the .mmpk mobile map package
1717
"https://www.arcgis.com/home/item.html?id=2b0f9e17105847809dfeb04e3cad69e0",

display-map-from-mobile-map-package/src/main/java/com/esri/arcgisruntime/sample/displaymapfrommobilemappackage/DownloadActivity.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@ import java.io.File
2424
class DownloadActivity : DownloaderActivity() {
2525
override fun onCreate(savedInstanceState: Bundle?) {
2626
super.onCreate(savedInstanceState)
27-
val downloadFolder = File(
28-
getExternalFilesDir(null)?.path.toString() + File.separator + getString(R.string.app_name)
29-
)
3027
downloadAndStartSample(
3128
Intent(this, MainActivity::class.java),
32-
// get the download path of the sample
33-
downloadFolder.path,
29+
// get the app name of the sample
30+
getString(R.string.app_name),
3431
listOf(
3532
// ArcGIS Portal item containing the .mmpk mobile map package
3633
"https://www.arcgis.com/home/item.html?id=e1f3a7254cb845b09450f54937c16061"

samples-lib/src/main/java/com/esri/arcgisruntime/sample/sampleslib/DownloaderActivity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ abstract class DownloaderActivity : AppCompatActivity() {
6060

6161
/**
6262
* Gets the [provisionURL] of the portal item to download at
63-
* the [samplePath], once download completes it starts the [mainActivity]
63+
* the [sampleName], once download completes it starts the [mainActivity]
6464
*/
6565
fun downloadAndStartSample(
6666
mainActivity: Intent,
67-
samplePath: String,
67+
sampleName: String,
6868
provisionURLs: List<String>
6969
) {
70+
// get the path to download files
71+
val samplePath: String = downloadFolder(sampleName)
7072
// start the download manager to automatically add the .mmpk file to the app
7173
// alternatively, you can use ADB/Device File Explorer
7274
lifecycleScope.launch {

0 commit comments

Comments
 (0)