Application behaves differently in Device

mozaharul

Active Member
Licensed User
Hi,

I made a project, it works fine in the desktop. when the setup file is created and installed in the device, it behaves differently.
Example: In the application selection of future date in the 1st tabpage freezes other tabpages and the controls as well. it works fine in the desktop.

code :
Sub tbc2_selectionchanged(Index,"") 'sub for Freezing all other tabpages except the 1st tabpage.
If tbc2.selectedindex > 0 AND hh=1 Then
tbc2.selectedindex=0
End If
End Sub

here hh=1, means future date selected.

any suggestions ?


regards
 

agraham

Expert
Licensed User
Assuming tbc2 is a tab control then I think that having parameters to tbc2_selectionchanged is wrong. I don't know if it is causing a problem but I'd first remove them. Having an empty string as a parameter is wrong anyway! Presumably you haven't optimised compiled this - I think the compiler would choke on that and the prescence of un-needed parameters.

If it's not the above then it's only a guess but changing "tbc2.selectedindex=0" in the SelectionChanged event may cause another SelectionChanged event to occur and the Sub to be re-entered The first thing I would try is to comment out that line and see if the problem goes away. Then you could try

B4X:
Sub Globals
  InEvent = false
End Sub

Sub tbc2_selectionchanged(Index,"") 
  If InEvent then
    Return
  Else
    InEvent = True
    If tbc2.selectedindex > 0 AND hh=1 Then 
      tbc2.selectedindex=0 
    End If
    InEvent = False
  End If
End Sub
 

mozaharul

Active Member
Licensed User
Thanks for your time and Sorry for my late response.

Its the same as before, work on desktop but not on the device.

regards,
 

agraham

Expert
Licensed User
Its the same as before, work on desktop but not on the device.
We need a LOT more detail than this to even start to help. Have you optimised compiled the code? That compiler is very fussy and may show where a problem lies. If it gets through the optimising compiler and still misbehaves you need to remove bits from your code until the problem goes away. That will give you some idea of where the problem lies. If you can't then find the problem post the smallest bit of code you can make that shows the problem.
 
Top