AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones de ejecutables
  • Special cases
  • Aplicación en segundo plano: Caso concreto de Android 10
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Opens a popup allowing you to select the application that will be used to share a resource (text or document). The application will be opened with the specified resource.
For example, an image can be shared with the application for sending emails. In this case, a new email will be created with the specified image in attachment.
Ejemplo
AndroidWidget Android
// Share an image displayed in an Image control
sPath is TO string = CompleteDir(SysDirExternalStorage(1, ssePublicPhoto)) + "MyImage.png"
IF dSaveImagePNG(IMG_Image, sPath) = True THEN
	NextTitle("Sharing an image")
	StartShare(sPath) 
END
iPhone/iPad
// Share an image displayed in an Image control
sPath is string = CompleteDir(fDataDir()) + "MyImage.png"
IF dSaveImagePNG(IMG_Image, sPath) = True THEN
NextTitle("Sharing an image")
StartShare(sPath)
END
// Share a text displayed in an edit control
IF StartShare(shareText, EDT_Edit) = False THEN
Error(ErrorInfo())
END
Sintaxis
<Result> = StartShare([<Type>, ] <Parameter 1> [, <Parameter 2> [... [, <Parameter N>]]])
<Result>: Boolean
  • True if the specified resources can be shared.
    Remarks:
    • This function is not blocking: the code following the function call will continue to run as soon as the popup has been displayed.
    • It is not possible to find out whether an application was selected by the user to perform the share.
  • False if no application allowing to share the resources is found. To get more details on the error, use ErrorInfo.
<Type>: Optional Integer constant
Type of resource to share:
shareDocument
(Default value)
One or more documents (image, video, pdf, ...) are shared. These documents are identified by their full path, specified as parameter (<Parameter 1> to <Parameter N>).
The document must be located on the device's shared memory (e.g. the SDCard) so that it can be manipulated by the third-party application selected for sharing.
iPhone/iPad Only the images are supported.
shareTextText is shared.
If several character strings are specified as parameters (<Parameter 1> to <Parameter N>), they are concatenated and separated by carriage returns (CR).
Android Please note: The Facebook application does not support automatic text sharing.
<Parameter 1>: Character string
First resource to share. Corresponds to:
  • a file path (if the shareDocument constant is used).
  • a character string (if the shareText constant is used).
<Parameter 2>: Optional character string
Second resource to share. Corresponds to:
  • a file path (if the shareDocument constant is used).
  • a character string (if the shareText constant is used).
<Parameter N>: Optional character string
Last resource to share. Corresponds to:
  • a file path (if the shareDocument constant is used).
  • a character string (if the shareText constant is used).
Observaciones

Special cases

  • To customize the title of popup for selecting the application, use NextTitle before StartShare.
  • If only one application lets you share the resource on the mobile, the popup is not displayed and the application starts directly.
  • Android Note: This function is available in the Android emulator.. This function is not available in the Android simulator.
AndroidWidget Android

Aplicación en segundo plano: Caso concreto de Android 10

A partir de Android 10, no se puede abrir una ventana si la aplicación está en segundo plano.
La función StartShare puede abrir una ventana. Si se utiliza esta función cuando la aplicación está en segundo plano, se producirá un error fatal.
Consejos:
  • Para saber si la aplicación está en segundo plano, utilice la función InBackgroundMode.
  • Si una aplicación necesita interactuar con el usuario cuando está en segundo plano, se puede mostrar una notificación (con el tipo Notification). La aplicación volverá al primer plano cuando se haga clic en la notificación, si la propiedad ActivateApplication se establece en True. También es posible abrir una ventana desde el procedimiento pasado a la propiedad ActionClick.
Para obtener más información, consulte Android 10: Comportamiento de las aplicaciones en segundo plano.
Componente: wd300android.aar
Versión mínima requerida
  • Versión 18
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local