Android Question InvocationTargetException when loading Layout1

FERNANDO SILVEIRA

Active Member
Licensed User
Hello Guys,

I'm having hard time to test this app. It is presenting the following error when I do an
B4X:
    Activity.LoadLayout("Layout1")

App basic code:
  1. Load Layout1 (1 panel with 1 label field)
  2. User click on label ==> start Content Chooser to select a photo
  3. Load selected photo on image field (panel 2)
  4. Crop & save cropped image
  5. Return to layout1 with label filled with cropped image



Log messages:

** Activity (main) Create, isFirst = true **
Error occurred on line: 42 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)


Any clues will be welcome.

Regards,
Fernando
 

Attachments

  • PhotoPicker.zip
    10.4 KB · Views: 411

FERNANDO SILVEIRA

Active Member
Licensed User
Your code is incomplete.
You need add the lines to content provider definition in manifest:
https://www.b4x.com/android/forum/threads/sharing-files-from-your-app-with-file-provider.70458/
and put the resource folder of cropImageView library in the project:
https://www.b4x.com/android/forum/threads/cropimageview-v1-0.52278/

Thank you,Asales...
Regarding resource folder I didn't figured out how important its content is.

It is working now, after all these changes.
 
Upvote 0
Top