Android Question Method: setCustomDensity not matched.

watesoft

Active Member
Licensed User
Longtime User
I inline java in B4A.
Java Method:
JAVA:
public void setCustomDensity(@NonNull Activity activity, @NonNull final Application application)

B4A:
B4A:
Dim JO As JavaObject
JO.RunMethod("setCustomDensity",Array(Activity,Application))

Error occurred: java.lang.RuntimeException: Method: setCustomDensity not matched.

How to use this method correctly?
 

watesoft

Active Member
Licensed User
Longtime User
Too much information is missing here in order to help you.
Sorry,I upload the project and logs
Logs:
Logger connected to:  HUAWEI BLN-AL30
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 56 (Main)
java.lang.RuntimeException: Method: setCustomDensity not matched.
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:129)
    at wzq.water.watercal.main._activity_create(main.java:412)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at wzq.water.watercal.main.afterFirstLayout(main.java:112)
    at wzq.water.watercal.main.access$000(main.java:25)
    at wzq.water.watercal.main$WaitForLayout.run(main.java:90)
    at android.os.Handler.handleCallback(Handler.java:761)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:156)
    at android.app.ActivityThread.main(ActivityThread.java:6523)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
** Activity (main) Resume **
 

Attachments

  • WaterCal.zip
    91.4 KB · Views: 128
  • support-annotations-25.3.1.zip
    15.1 KB · Views: 97
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top