Accueil → WINDEV Mobile 25 → [WM23] Procedure JAVA - Intent
[WM23] Procedure JAVA - Intent
Débuté par ARV, 07 fév. 2019 22:29 - Aucune réponse
Membre enregistré
443 messages
Posté le 07 février 2019 - 22:29
Hi all

I have this issue at the moment:

I have a procedure JAVA
there I put all I need to receive an image, file, etc. from another app
on the Compile section it launch an error of Intent intent = getIntent();

I don't know why is this happening, I import all the things I need to get it work.
I even add some code on the manifest.xml of windev mobile just to make sure on the Share Menu Android my app appear tos to share and image or text to my app.
Then because I can't code on OnCreate I can't put the getIntent(); and then get all I need to work with the text or image. but on Windev I can't work on OnCreate method of android.

So I create a procedure but then again I can't compile thep roject because Windev (Java) can't find the symbol of getIntent();
I search everywhere and I can't find a solution. I really need to get the image or text shared from another app to my app.

anyone have an idea?

Here is the source someone give it to me on this forum to get the app on the share Menu of Android and also the code I need to put in java to process the shared element:

In every website I search it's always talk about the OnCreate method of Android Studio, and also this method on his class needs to be extended from the Activity just to get it work, and I can't access to those methods.

Heres my java code:

import android.content.Intent;
import android.app.Activity;
import android.content.Context;

import android.app.Fragment;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

PUBLIC static void Test()
// Get intent, action and MIME type
Intent intent = getIntent(); //HERE it's the error Windev (Java) see "Cannot find symbol"
string action = intent.getAction();
string type = intent.getType();

IF (Intent.ACTION_SEND.equals(action) && type != Null) {
IF ("text/plain".equals(type)) {
//handleSendText(intent); // Handle text being sent
} ELSE IF (type.startsWith("image/")) {
//handleSendImage(intent); // Handle single image being sent
} ELSE IF (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != Null) {
IF (type.startsWith("image/")) {
//handleSendMultipleImages(intent); // Handle multiple images being sent
} ELSE {
// Handle other intents, such as being started from the home screen

Best Regards
Message modifié, 07 février 2019 - 22:31