Sub Process_Globals
Private cc As ContentChooser
End Sub
Sub Globals
Private WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Dim client As JavaObject
client.InitializeNewInstance(Application.PackageName & ".main$MyChromeClient",
Null)
Dim jo As JavaObject = WebView1
jo.RunMethod("setWebChromeClient", Array(client))
WebView1.LoadUrl("yourwebsite/index.php")
End Sub
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
1条答案
按热度按时间vdgimpew1#
使用contentchooser库,有关详细信息,您可以使用以下代码