Sub ShowFile_Chooser (FilePathCallback As Object, FileChooserParams As Object)
cc.Initialize("CC")
cc.Show("*/*", "Choose File")
Wait For CC_Result (Success As Boolean, Dir As String, FileName As String)
Dim jo As JavaObject = Me
If Success Then
Log(FileName)
File.Copy(Dir, FileName, Starter.Provider.SharedFolder, "TempFile")
jo.RunMethod("SendResult", Array(Starter.Provider.GetFileUri("TempFile"), FilePathCallback))
Else
jo.RunMethod("SendResult", Array(Null, FilePathCallback))
End If
End Sub
#if Java
import android.webkit.*;
import android.webkit.WebChromeClient.*;
import android.net.*;
public static void SendResult(Uri uri, ValueCallback<Uri[]> filePathCallback) {
BA.Log("value = " + uri);
if (uri != null)
filePathCallback.onReceiveValue(new Uri[] {uri});
else
filePathCallback.onReceiveValue(null);
}
public static class MyChromeClient extends WebChromeClient {
[USER=69643]@override[/USER]
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback,
FileChooserParams fileChooserParams) {
processBA.raiseEventFromUI(this, "showfile_chooser", filePathCallback, fileChooserParams);
return true;
}
}
#End If