Dear All,
I am using library WebkitWebChromeClient on this post
I have update the manifest
but when the page using file upload html there is error
I want using this library to upload file from webview component. Any one can solve this issue?
I am using library WebkitWebChromeClient on this post
I have update the manifest
manifest:
SetApplicationAttribute(android:usesCleartextTraffic,"true")
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.CAPTURE_AUDIO_OUTPUT)
AddPermission(android.permission.CAPTURE_SECURE_VIDEO_OUTPUT)
AddPermission(android.permission.CAPTURE_VIDEO_OUTPUT)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(android.permission.RECORD_AUDIO)
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS)
AddPermission(android.permission.MICROPHONE)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.DOWNLOAD_WITHOUT_NOTIFICATION)
Code:
Sub Globals
Dim WebView5 As WebView
Private webkit As WebkitWebChromeClient
End Sub
Sub Activity_Create(FirstTime As Boolean)
webkit.Initialize(Me,"webkit",WebView5,True)
End Sub
Private Sub webkit_FileChooserInitialized (FilePathCallback As Object, FileChooserParams1 As WebkitFileChooserParams)
'ForceIsCaptureEnabled As Boolean:
' True: Use resources such as camera, microphone, etc. by force if the required file format is appropriate.
' False: Use a predefined value assigned to FileChooserParams.
webkit.FileChooserStart(FilePathCallback,FileChooserParams1,False) 'Use this method or use your own method from given parameters
End Sub
but when the page using file upload html there is error
error:
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (whizmatesign) Create (first time) **
** Activity (whizmatesign) Resume **
Error occurred on line: 135 (whizmatesign)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4a.android.webkit.webkitwebchromeclient._showfile_chooser(webkitwebchromeclient.java:1325)
at b4a.android.webkit.webkitwebchromeclient._filechooserstart(webkitwebchromeclient.java:172)
at whizmate.app.whizmatesign._webkit_filechooserinitialized(whizmatesign.java:1440)
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:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114)
at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:1077)
at b4a.android.webkit.webkitwebchromeclient._onshowfilechooser(webkitwebchromeclient.java:790)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at b4a.android.webkit.webkitwebchromeclient$MyChromeClient.onShowFileChooser(webkitwebchromeclient.java:1660)
at SC0.e(chromium-TrichromeWebViewGoogle.aab-stable-573506031:31)
at sc.runFileChooser(chromium-TrichromeWebViewGoogle.aab-stable-573506031:28)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7941)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
Caused by: java.lang.NullPointerException: Attempt to read from field 'android.content.pm.ActivityInfo android.content.pm.ResolveInfo.activityInfo' on a null object reference in method 'java.util.List b4a.android.webkit.webkitwebchromeclient.createExtraIntentList(android.content.Intent)'
at b4a.android.webkit.webkitwebchromeclient.createExtraIntentList(webkitwebchromeclient.java:1431)
... 28 more