File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
add-feature-layers/src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers
samples-lib/src/main/java/com/esri/arcgisruntime/sample/sampleslib Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,10 @@ import java.io.File
88class DownloadActivity : DownloaderActivity () {
99 override fun onCreate (savedInstanceState : Bundle ? ) {
1010 super .onCreate(savedInstanceState)
11- val downloadFolder = File (
12- getExternalFilesDir(null )?.path.toString() + File .separator + getString(R .string.app_name)
13- )
1411 downloadAndStartSample(
1512 Intent (this , MainActivity ::class .java),
1613 // get the download path of the sample
17- downloadFolder.path ,
14+ downloadFolder(getString( R .string.app_name)) ,
1815 listOf (
1916 // ArcGIS Portal item containing the .mmpk mobile map package
2017 " https://www.arcgis.com/home/item.html?id=2b0f9e17105847809dfeb04e3cad69e0" ,
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ abstract class DownloaderActivity : AppCompatActivity() {
107107 .setTitle(" Download data?" )
108108
109109 if (provisionFolder.list()?.isNotEmpty() == true ) {
110- // folder exists , prompt user to download again
110+ // folder is not empty , prompt user to download again
111111 provisionQuestionDialog.setMessage(getString(R .string.already_provisioned))
112112 // if user taps "Re-download" data
113113 provisionQuestionDialog.setNeutralButton(" Re-download data" ) { dialog, _ ->
@@ -272,4 +272,8 @@ abstract class DownloaderActivity : AppCompatActivity() {
272272 emit(LoadStatus .FailedToLoad (it))
273273 }
274274 }
275+
276+ fun downloadFolder (appName : String ): String {
277+ return getExternalFilesDir(null )?.path.toString() + File .separator + appName
278+ }
275279}
You can’t perform that action at this time.
0 commit comments