diff --git a/packages/core/utils/index.android.ts b/packages/core/utils/index.android.ts index 98f1fdb4f..827068c4b 100644 --- a/packages/core/utils/index.android.ts +++ b/packages/core/utils/index.android.ts @@ -81,7 +81,7 @@ function getMimeTypeNameFromExtension(filePath: string): string { * @param {string} filePath * @returns {boolean} whether opening the file succeeded or not */ -export function openFile(filePath: string): boolean { +export function openFile(filePath: string, title: string = 'Open File...'): boolean { const context = ad.getApplicationContext(); try { // Ensure external storage is available @@ -108,7 +108,7 @@ Applications cannot access internal storage of other application on Android (see // Determine file mimetype & start creating intent const mimeType = getMimeTypeNameFromExtension(filePath); const intent = new android.content.Intent(android.content.Intent.ACTION_VIEW); - const chooserIntent = android.content.Intent.createChooser(intent, 'Open File...'); + const chooserIntent = android.content.Intent.createChooser(intent, title); intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); chooserIntent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); diff --git a/packages/core/utils/index.d.ts b/packages/core/utils/index.d.ts index ec047b899..339da5019 100644 --- a/packages/core/utils/index.d.ts +++ b/packages/core/utils/index.d.ts @@ -242,8 +242,9 @@ export function openUrl(url: string): boolean; /** * Opens file. * @param filePath The file. + * @param title Optional title for Android. Default is: 'Open File...' */ -export function openFile(filePath: string): boolean; +export function openFile(filePath: string, title?: string): boolean; /** * Escapes special regex symbols (., *, ^, $ and so on) in string in order to create a valid regex from it.