Android Question Issue switching between activities

jeffnooch

Member
Licensed User
Longtime User
I created a menu option to close out of the current activity and start a new activity...
it seems to work fine on my Samsung Galaxy S7 phone...
it works most of the time on my Nexus 10 tablet...
it never works on my Coby 9.7 tablet...

the only conclusion i can come to is maybe something to do with OS versions?
any thoughts?
thanks in advance


B4X:
Sub mnuX_Click
    Dim Answ As Int
    Dim txt As String
    txt = "Do you really want to quit the current " & vX & " activity?" & CRLF & "NOTE: You will lose the current progress."
    Answ = Msgbox2(txt, "A T T E N T I O N", "Yes", "", "No", Null)
    If Answ = DialogResponse.POSITIVE Then
      Main.vX = 1  'set a variable in the main activity....should this maybe be after the activity.finish?
     Activity.Finish
     StartActivity("X")
    End If
End Sub
 

jeffnooch

Member
Licensed User
Longtime User
i lent out my tablet which always doesn't work...hopefully i should be getting it back tonight and can run some quick test and see if anything in log...

but basically it closes the current activity and looks like it is going to open the other activity but basically all the fields are greyed out and not all the labels are showing
 
Upvote 0

jeffnooch

Member
Licensed User
Longtime User
finally had a chance to put this in debug...but not seeing anything in the logs...

i even tried to change the code to something like this where just calling a sub inside same activity instead of finishing the activity....

if I click the menu, then click the menu option, then click the menu option (or any part of the screen) again (instead of clicking on the msgbox)
if i do that fast and multiple times the current activity just closes and goes back to the main activity
can't specifically define an exact way to duplicate...just randomly doing what i have above enough times seems to cause the problem...
NOTE: no matter how hard i tried i could NOT get this to behave this way on my Samsung Galaxy S7 (it always seems to works the way i think it should...ie not closing out of the current activity randomly)

the weird thing is it works most of the time on my Galaxy Nexus 10 and Amazon Fire 7...but i can make it fail on these devices regularly...

could it be a menu issue? msgbox issue? manifest editor issue? O/S issue?
just not sure what could cause the activity to close when it's not getting it from the code...

any thoughts would be great...


B4X:
Sub mnuX_Click
   Dim Answ As Int
   Dim txt AsString
    txt = "Do you really want to quit the current " & vX & " activity?" & CRLF & "NOTE: You will lose the current progress."
    Answ = Msgbox2(txt, "A T T E N T I O N", "Yes", "", "No", Null)
   If Answ = DialogResponse.POSITIVE Then
        Main.vX = 1 'set a variable in the main activity....should this maybe be after the activity.finish?
        NewSub      ' call a sub in the current activity
   EndIf
End Sub
 
Upvote 0
Top