PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Creating a SHARE button in Android
Creating a SHARE button in Android
Started by Luca Forti, Sep., 06 2017 10:21 AM - 1 reply
Connect yourself…
Luca Forti
#1
Posted on September, 06 2017 - 10:21 AM
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
Report
0
0
Rubén Sánchez Peña
#2
Registered member
797 messages
Popularité : +40 (42 votes)
Posted on September, 06 2017 - 11:46 AM
Hi. Change "PUBLIC" to "public"
Rubén
Message modified, September, 06 2017 - 11:47 AM
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text