Android Question app crash on .SetOnTouchListener("B_OnTouch")

rkxo

Active Member
Licensed User
Longtime User
hi , my app crash when i run this sub. Any idea? no catch work , crash all app.

thanks

B4X:
Sub B_OnTouch( viewtag As Object, action As Int, X As Float, Y As Float, motionevent As Object) As Boolean
   Try
       Select action
           Case Activity.ACTION_DOWN
               t1ii = DateTime.Now
               Try
                   If File.Exists(Ruta,"averia.mp3") Then
                       File.Delete(Ruta,"averia.mp3")
                   End If
                   Ar.Initialize
 
                   Ar.AudioSource=Ar.AS_MIC
                   Ar.OutputFormat=Ar.OF_THREE_GPP
                   Ar.AudioEncoder=Ar.AE_AMR_NB
                   Ar.setOutputFile(Ruta,"averia.mp3")
                   Ar.prepare
                   Ar.start
               Catch
                   Return False
                   Log(LastException)
               End Try
          
           Case Activity.ACTION_UP
               t2ii = DateTime.Now
               Log(t2ii-t1ii)
               Try
          
                   Dim o As Int=Msgbox2("Desitja gravar el missatge de veu",Trans.GetText("140"),"Crear",Trans.GetText("142"),"",Null)
                   Select o
                       Case -1
                           If CrucePrimeroNumGps.Length>0 Then
                               GuardaAudioAveriaGPS(CrucePrimeroNumGps,CrucePrimeroNombreGps)
                               recgpsbut.Invalidate
                               Return False ' after this point crash
                           End If
                   End Select
                   Return False
               Catch
                   Log(LastException)
                   Return False
               End Try
      
       End Select
       recgpsbut.Invalidate
       Return True
   Catch
       Log(LastException)
       recgpsbut.Invalidate
 
   End Try

End Sub



 

rkxo

Active Member
Licensed User
Longtime User
Thanks to Erel, but I've been searching and I can not find the reference to this file in the code or in the .bal files. Where can it be?
 
Upvote 0

rkxo

Active Member
Licensed User
Longtime User
hi, now i captured this.
Unexpected event (missing RaiseSynchronousEvents): b_ontouch
Check the unfiltered logs for the full stack trace.
raiseEvent for b_ontouch returned null

i add "return false" in catch exception , but crash too..
all roads return a value
 
Upvote 0

rkxo

Active Member
Licensed User
Longtime User
HI,now i put this file ic_action_menu.png in project and app crash too. any idea?

thanks

 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…