Android Example [Inline Java] Get The Method Name

Hi, there is attachment with example on how to get the method (b4a function - sub) name using Inline Java.
This can be useful in many cases, especially for error reporting - debugging, but there are ton of other use case scenarios :)
See it for your self
 

Attachments

  • GetTheMethodName.zip
    13.9 KB · Views: 517

baron

Member
Licensed User
Longtime User
Hi Erel,

I'm trying to interface with a 3rd party Android credit card app from B4A. It will start the app, but locks up. I suspect the 1st parameter to initiatePayment is wrong. It locks up when I call it with the B4A Activity.

Note that TransactionRequest is a structure which is created by another method in the same jar. It seems to work OK, so I'm assuming the problem is the 1st parameter.

public void Stage3(Activity BA) {

// create a currency object with specified locale

try {

String orderId = "456789";

PaylevenApi.initiatePayment(BA, orderId, request);

}
catch (NumberFormatException e) {
Toast.makeText(getApplicationContext(), "invalid_amount", Toast.LENGTH_LONG).show();
}
}


Supplied documentation is as follows:

"Issues a TransactionRequest to the app. You need to override onActivityResult of your Activity to receive the response"
Parameters:
activity - the activity that will receive the result
orderId - a unique id that identifies the payment.
 
Top