Handling file uploads I need to pass an array of uri's to a android.webkit.ValueCallback
def handleResult(intent)
uri = Android::Net::Uri.parse(intent.getDataString)
file_path_callback.onReceiveValue([uri])
end
The problem is that onReceiveValue expects an array of android.net.Uri and the following error is raised:
Java exception raised: java.lang.ClassCastException: java.util.ArrayList cannot be cast to android.net.Uri[]
How do I cast the array to the proper types?
I fixed it by adding a
Utilclass and implementing a class method in java.In
util.rbIn
util.javaThen pass the callback to the Util method: