OK, I'm right a the end of something, and this is the last annoying thing I have to solve. This is a strange one... This almost always works, but one of my tester gets this error on his tablet, I don't. This works EVERY time on my phone. This FAILS EVERY TIME on the Genymotion emulator to match my phone (Moto-X). This is definitely a timing issue because it DOESN"T happen in either of the two debug modes (rapid/legacy) but does happen in release or release(obfuscated).
In the chooser's success module I have the following code (this is a snippet). I have all of the MsgBox calls to see how far it's getting:
This fails on the b.Initialize call. Well, not really... never seems to get to it. In Debug mode, it gets to the last MsgBox but in release mode, it goes from there to Activity_Resume and never hits MsgBox 4. I have the following sub, called from Activity_Resume:
The program fails on the b.Initialize call above. Gets to the first MsgBox, not the second (error is in screenshot below). I have tried everything I can think of to get the file to be saved before getting to that red call above, but it seems to always get to Activity_Resume before I can save the file. I've even done a File.Copy(Dir, FileName, ImageFileDir, ImageFileName) before the call to initialize b in the cc_Result sub.
It's not regular, and can't be duplicated on all devices. I have a Moto-X... works fine, even with a new, empty data file... I have a crappy tablet... Works fine on that. Genymotion fails ever time. Tester's tablet fails every time...
The error:
Any suggestions on how to get past this? FYI, the RestorePic code is there to bring back a picture if orientation has changed.
In the chooser's success module I have the following code (this is a snippet). I have all of the MsgBox calls to see how far it's getting:
B4X:
Sub cc_Result (Success As Boolean, Dir As String, FileName As String)
If Success Then
ChangesMade = True
If CurrentTempPicFile.Trim = "" AND ImageFileName.Trim = "" Then
Try
ImageFileDir = File.DirInternal
iv.Visible = False
Msgbox("1","Got Here!")
CreateNewFileName
Msgbox("2","Got Here!")
ImageFileName = NewFileName
Msgbox("3" & CRLF & Dir & CRLF & FileName,"Got Here!")
b.Initialize(Dir, FileName)
Msgbox("4","Got Here!")
This fails on the b.Initialize call. Well, not really... never seems to get to it. In Debug mode, it gets to the last MsgBox but in release mode, it goes from there to Activity_Resume and never hits MsgBox 4. I have the following sub, called from Activity_Resume:
B4X:
Sub RestorePic
iv.Visible = False
'WAS HERE
Msgbox("Restore Pic 1","Here")
b.Initialize(ImageFileDir, ImageFileName)
Msgbox("Restore Pic 2","Here")
ResizePhoto(File.DirInternal, ImageFileName)
iv.Bitmap = b
iv.Visible = True
EditPic.Visible = True
DelPic.Visible = True
ivPreview.Visible = False
btnRotateRight.Visible = False
btnRotateLeft.Visible = False
End Sub
The program fails on the b.Initialize call above. Gets to the first MsgBox, not the second (error is in screenshot below). I have tried everything I can think of to get the file to be saved before getting to that red call above, but it seems to always get to Activity_Resume before I can save the file. I've even done a File.Copy(Dir, FileName, ImageFileDir, ImageFileName) before the call to initialize b in the cc_Result sub.
It's not regular, and can't be duplicated on all devices. I have a Moto-X... works fine, even with a new, empty data file... I have a crappy tablet... Works fine on that. Genymotion fails ever time. Tester's tablet fails every time...
The error:
Any suggestions on how to get past this? FYI, the RestorePic code is there to bring back a picture if orientation has changed.