Android Question _onActivityResult inside "Inline java"

abilio486software

Active Member
Licensed User
How can I have access to the _onActivityResult function within "inline java", in the same way that I have access to the "_OnCreate" function?

It is necessary because I am working with intents that I call from "inline java" and that I need to receive the preferential answer within "inline java".

It's not possible?

How should I do?

Many Thanks,
Abilio
 

abilio486software

Active Member
Licensed User
The less you do in Java the better. Handling this event from Java is explained here: https://www.b4x.com/android/forum/threads/java-guide-using-onactivityresult.7297/#content

Erel Many thanks,

But when I add this to inline Java:
public interface IOnActivityResult {
void ResultArrived(int resultCode, Intent intent);
}

I Get the image error:

B4X:
B4A Version: 10.70
Parsing code.    (0.01s)
    Java Version: 8
Building folders structure.    (0.01s)
Compiling code.    (0.05s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (1.64s)
Linking resources    (1.71s)
Compiling generated Java code.    Error
javac 1.8.0_241
src\sibs\b4a\example\main.java:389: error: cannot find symbol
public sibs.b4a.example.starter _vv2 = null;
                       ^
  symbol:   class starter
  location: package sibs.b4a.example
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
 
Last edited:
Upvote 0

abilio486software

Active Member
Licensed User
Please post text as text.

Sorry ?

This is the error when adding the function to the inline Java:

B4A Version: 10.70
Parsing code. (0.01s)
Java Version: 8
Building folders structure. (0.01s)
Compiling code. (0.05s)

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.02s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (1.64s)
Linking resources (1.71s)
Compiling generated Java code. Error
javac 1.8.0_241
src\sibs\b4a\example\main.java:389: error: cannot find symbol
public sibs.b4a.example.starter _vv2 = null;
^
symbol: class starter
location: package sibs.b4a.example
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
 
Upvote 0

abilio486software

Active Member
Licensed User
I'm sorry but I don't know what you are doing. What is sibs.b4a.example? Is this your package name?

Why are you using inline Java? It requires Java knowledge.

Yes, "sibs.b4a.example" is my test packagename, defined on "Project / Build Configurations"

And yes I use "inline java" when I need to talk at a lower level with external librarys, mainly for payment machines like myPOS,SaltPay, Portuguese SIBS, Verifone, etc... Each one have a different SDK or library, sometimes .Jar, others .aar, so I use some inlinejava.

And now SIBS use intents and they respond directly to "onActivityResult".

On our Android Studio tests, it works. But our project is made with B4A, so we need to implement it with "inline java", because I think you don't have hooking that call natively on B4A.

That's why we need to access "onActivityResult" from inline java, just like you have done with "_onCreate".
 
Upvote 0

ArminKh1993

Active Member
How can I have access to the _onActivityResult function within "inline java", in the same way that I have access to the "_OnCreate" function?

It is necessary because I am working with intents that I call from "inline java" and that I need to receive the preferential answer within "inline java".

It's not possible?

How should I do?

Many Thanks,
Abilio
B4X:
#IF JAVA
    public void _onactivityresult(int requestCode,int resultCode){
        // Do Some Thing
    }
#END IF
 
Upvote 0
Top