FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
Creating a SHARE button in Android
Creating a SHARE button in Android
Débuté par Luca Forti, 06 sep. 2017 10:21 - 1 réponse
Connectez-vous…
Luca Forti
#1
Posté le 06 septembre 2017 - 10:21
Hi everyone, I'm trying to create a share button in my android application to open the share chooser and send a text.
I found this java code online (it works in Android Studio) but I can't make it work in WinDev:
import android.content.Intent;
import android.content.Context;
import android.app.Activity;
PUBLIC static void OpenShare()
{
// Context context;
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, "Send text..."));
}
I wrote the code in a global procedure but when I generate the app, the error is:
Failure creating the Android application named <C:\My Mobile Projects\XXXXXXXX\Exe\Android application\XXXXXXXX.apk>.
Command Line: "C:\Program Files\Java\jdk1.8.0_111\bin\java.exe" "-Dorg.gradle.appname=C:\My Mobile Projects\XXXXXXXX\Android\Generation" -classpath "C:\WINDEV Mobile 22\Personal\Android\Gradle\lib\gradle-launcher-2.14.1.jar" org.gradle.launcher.GradleMain assembleRelease -b "C:\My Mobile Projects\XXXXXXXX\Android\Generation\build.gradle"
Error returned:
:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
C:\My Mobile Projects\XXXXXXXX\Android\Generation\src\com\XXXXXXXX\XXXXXXXX\wdgen\GWDCPCOL_Java.java:31: error: <identifier> expected
PUBLIC static void OpenShare()
^
1 error
:compileReleaseJavaWithJavac FAILED
--------------------
Can someone help me?
Luca
Signaler
0
0
Rubén Sánchez Peña
#2
Membre enregistré
794 messages
Popularité : +40 (42 votes)
Posté le 06 septembre 2017 - 11:46
Hi. Change "PUBLIC" to "public"
Rubén
Message modifié, 06 septembre 2017 - 11:47
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte