Android Question tts voice

hookshy

Well-Known Member
Licensed User
Longtime User
I have one problem using tts voice ! Service is starting tts and speeks a content while i am in a call witch is not so appropriate . I tried to use Phone Events to catch the phone call state but it seems i does not work I don't now how to handle it !

B4X:
Sub ev_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
'State - One of the three values: IDLE, OFFHOOK, RINGING. OFFHOOK means that there Is a call OR that the Phone Is dialing.
'IncomingCall - Available when the State value Is RINGING.
If State="RINGING" OR State="OFFHOOK" Then
   stop_reading=True
Else
   stop_reading=False
End If

ToastMessageShow(State,True)
   
End Sub
 

hookshy

Well-Known Member
Licensed User
Longtime User
Dim ev As PhoneEvents ' declared on proces globals
ev.Initialize("ev") ' initialized on service create

do I have to intitialize with
ev.InitializeWithPhoneState(eventname As String , PhoneId As PhoneId) ?
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
I think i will disable some app functins on detecting with pakage manager upon package name
if user has installed viber or something similar
 
Upvote 0
Top