There was a previous post:
Hi,
When I use this library on a second Activity and close the activity after viewing PDF and start it again I get " Fatal signal 11 (SIGSEGV) at 0x00000014 (code=1) "
Any suggestions?
I am having the same problem in that the first time I start the activity all works well, the next time my application restarts. Is there a way of releasing or clearing the memory associated with the PDFViewer object.
Again any suggestions would be appreciated.
Thanks
Dim r As Reflector
r.Target = pdfv
r.RunMethod2("getpdf",File.DirRootExternal&"/1.pdf","java.lang.string")
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim MF_File As MF_File
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ListView1 As ListView
Dim pdfv As PDFViewer
Dim i,pc As Int=0
Dim iv
Private Button1 As Button
Dim fileselezionato As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("pdf")
Activity.Title = "XXX Plus"
'Imposto ListView a tutta altezza
ListView1.Height = 100%y
Dim testPath As String = File.DirRootExternal&"/xxxplus/"
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(File.DirAssets, "pdf-icon.png")
If pdfv.IsInitialized = False Then
pdfv.init
End If
Activity.AddView(pdfv,0,50%y,-1,-1)
pdfv.Visible = False
Log("MF_File.ListFiles")
Dim files As List
files = MF_File.ListFiles(testPath, "*.pdf", True, False)
If files.IsInitialized Then
For Each f As String In files
Log(" " & f)
ListView1.AddTwoLinesAndBitmap(f, "File Pdf", Bitmap1)
Next
End If
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
ProgressDialogShow2("Anteprima File selezionato...",False)
DoEvents
ListView1.Height = 40%y
fileselezionato = Value
Button1.Visible = True
Button1.Text = "Click Here to " & Value & " to XXX"
'Leggo File Pdf in anteprima
pdfv.Visible = True
pdfv.getpdf(File.DirRootExternal&"/Ocrplus/"& Value)
If pdfv.isValid Then
'Log("pagecount:"&pdfv.PageCount)
pdfv.scrollToPage(0)
pc=pdfv.GetPageCount
pdfv.zoom(1.0)
ProgressDialogHide
Else
ProgressDialogHide
Msgbox("Error pdf file!","Error")
'Activity.Finish
'Return
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_KeyPress(KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK AND ListView1.Height = 40%y Then
Button1.Visible = False
pdfv.Visible = False
ListView1.Height = 100%y
Return True
Else If KeyCode = KeyCodes.KEYCODE_BACK AND ListView1.Height = 100%y Then
Activity.Finish
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
' Rivedere per far tornare indietro su immagini
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?